@@ -1,5 +1,5 @@
11use dodrio::bumpalo::{self, Bump};
2−use dodrio::{on, Node, Render};
2+use dodrio::Render;
33use log::*;
44use wasm_bindgen::prelude::*;
55
@@ -32,19 +32,15 @@ impl Render for Counter {
3232 where
3333 'a: 'bump,
3434 {
35+ use dodrio::builder::*;
36+
3537 // Stringify the count as a bump-allocated string.
3638 let count = bumpalo::format!(in bump, "{}", self.count);
3739
38− Node::element(
39− bump,
40− "div",
41− [],
42− [],
43− [
44− Node::element(
45− bump,
46− "button",
47− [on(bump, "click", |root, vdom, _event| {
40+ div(bump)
41+ .children([
42+ button(bump)
43+ .on("click", |root, vdom, _event| {
4844 // Cast the root render component to a `Counter`, since
4945 // we know that's what it is.
5046 let counter = root.unwrap_mut::<Counter>();
@@ -55,24 +51,20 @@ impl Render for Counter {
5551 // Since the count has updated, we should re-render the
5652 // counter on the next animation frame.
5753 vdom.schedule_render();
58− })],
59− [],
60− [Node::text("+")],
61− ),
62− Node::text(count.into_bump_str()),
63− Node::element(
64− bump,
65− "button",
66− [on(bump, "click", |root, vdom, _event| {
54+ })
55+ .children([text("+")])
56+ .finish(),
57+ text(count.into_bump_str()),
58+ button(bump)
59+ .on("click", |root, vdom, _event| {
6760 // Same as above, but decrementing instead of incrementing.
6861 root.unwrap_mut::<Counter>().decrement();
6962 vdom.schedule_render();
70− })],
71− [],
72− [Node::text("-")],
73− ),
74− ],
75− )
63+ })
64+ .children([text("-")])
65+ .finish(),
66+ ])
67+ .finish()
7668 }
7769}
7870