@@ -1,5 +1,5 @@
1use dodrio::bumpalo::{self, Bump};
1use dodrio::bumpalo::{self, Bump};
2−use dodrio::{on, Node, Render};
2+use dodrio::Render;
4use wasm_bindgen::prelude::*;
4use wasm_bindgen::prelude::*;
@@ -32,19 +32,15 @@ impl Render for Counter {
33 'a: 'bump,
33 'a: 'bump,
35+ use dodrio::builder::*;
35 // Stringify the count as a bump-allocated string.
37 // Stringify the count as a bump-allocated string.
36 let count = bumpalo::format!(in bump, "{}", self.count);
38 let count = bumpalo::format!(in bump, "{}", self.count);
46− "button",
42+ button(bump)
47− [on(bump, "click", |root, vdom, _event| {
43+ .on("click", |root, vdom, _event| {
48 // Cast the root render component to a `Counter`, since
44 // Cast the root render component to a `Counter`, since
49 // we know that's what it is.
45 // we know that's what it is.
50 let counter = root.unwrap_mut::<Counter>();
46 let counter = root.unwrap_mut::<Counter>();
@@ -55,24 +51,20 @@ impl Render for Counter {
55 // Since the count has updated, we should re-render the
51 // Since the count has updated, we should re-render the
56 // counter on the next animation frame.
52 // counter on the next animation frame.
57 vdom.schedule_render();
53 vdom.schedule_render();
60− [Node::text("+")],
55+ .children([text("+")])
62− Node::text(count.into_bump_str()),
57+ text(count.into_bump_str()),
65− "button",
58+ button(bump)
66− [on(bump, "click", |root, vdom, _event| {
59+ .on("click", |root, vdom, _event| {
67 // Same as above, but decrementing instead of incrementing.
60 // Same as above, but decrementing instead of incrementing.
68 root.unwrap_mut::<Counter>().decrement();
61 root.unwrap_mut::<Counter>().decrement();
69 vdom.schedule_render();
62 vdom.schedule_render();
72− [Node::text("-")],
64+ .children([text("-")])