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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! Utility library for the Yew frontend web framework.
//!
//! All features:
//!
//! * "neq" - NeqAssign trait
//! * "pure" - Pure components and function components.
//! * "future" - Async support for Yew Messages
//! * "fetch" - Wrapper that holds requests and responses.
//! * "mrc_irc" - Ergonomic Rc pointers.
//! * "lrc" - Linked-list Rc pointer.
//! * "history" - History tracker
//! * "store" - Global state with easy binding
// //! * "dsl" - Use functions instead of Yew's `html!` macro.

#[cfg(feature = "neq")]
mod not_equal_assign;

#[cfg(feature = "pure")]
mod pure;

#[cfg(any(feature = "mrc_irc", feature = "lrc"))]
pub mod ptr;

#[cfg(feature = "history")]
mod history;

#[cfg(feature = "history")]
pub use history::History;

#[cfg(feature = "neq")]
pub use not_equal_assign::{NeqAssign, NeqAssignBy};

#[deprecated]
#[cfg(feature = "pure")]
pub use pure::{Pure, PureComponent};

/// Define a component with a function
///
/// # Example
///
/// ```
/// # use yew::{html, Callback, Html, MouseEvent};
///
/// #[yewtil::function_component(Button)]
/// pub fn button(
///     callback: &Callback<MouseEvent>,
///     #[prop_or_default] text: String,
/// ) -> Html {
///     html! {
///         <button onclick=callback>{ text }</button>
///     }
/// }
///
/// # fn view() -> Html {
/// // You can then use it like a normal component
/// html! { <Button callback=Callback::from(|_| println!("Clicked")) text="Click me!" /> }
/// # }
/// ```
#[deprecated]
#[cfg(feature = "pure")]
pub use yewtil_macro::function_component;

#[cfg(feature = "fetch")]
pub mod fetch;

#[cfg(feature = "effect")]
mod effect;
#[deprecated]
#[cfg(feature = "effect")]
pub use effect::{effect, Effect};

#[cfg(feature = "future")]
pub mod future;

#[cfg(feature = "store")]
pub mod store;