-
Notifications
You must be signed in to change notification settings - Fork 3
/
lib.rs
50 lines (44 loc) · 1.08 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
pub mod app;
pub mod attribute_value;
pub mod component;
pub mod dehydrate;
pub mod elements;
pub mod hydrate;
pub mod option_string_value;
pub mod string_value;
#[cfg(target_arch = "wasm32")]
mod client;
#[cfg(target_arch = "wasm32")]
pub use crate::client::*;
#[cfg(not(target_arch = "wasm32"))]
mod server;
#[cfg(not(target_arch = "wasm32"))]
pub use crate::server::*;
pub mod prelude {
pub use crate::{
app::App,
clone,
component::Component,
dehydrate::Dehydrate,
elements::{html, html::*, svg},
fragment, html,
hydrate::hydrate,
text, Element, Fragment, Namespace, Node, SignalNode, SignalVecNode, Text,
};
pub use futures_signals::{
signal::{Mutable, Signal, SignalExt},
signal_vec::{MutableVec, SignalVec, SignalVecExt},
};
pub use pinwheel_macro::{builder, children, new};
}
pub use futures_signals::signal;
pub use futures_signals::signal_vec;
#[macro_export]
macro_rules! clone {
($($name:ident),*$(,)?) => {
$(let $name = $name.clone();)*
}
}
pub fn html<T: component::Component>(component: T) -> String {
format!("<!doctype html>{}", component.into_node())
}