bloom-html 0.1.3

Provides the HtmlNode type for bloom-client and bloom-server
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// Event handlers are basically just closures that take a web_sys::Event as an argument.
/// This type only provides a convenience for implementing the actual render-functions.
pub type EventHandler = Box<dyn Fn(web_sys::Event) + Send + Sync + 'static>;

#[cfg(test)]
mod tests {

    use crate::{tag::button, HtmlElement};

    #[test]
    fn build_button() {
        let button: HtmlElement = button().on("click", |_| {}).build();

        let _cb = button.callbacks().get("click");
    }
}