Support event subscriptions in iced_web

Also improves the overall web runtime, avoiding nested update loops.
This commit is contained in:
Héctor Ramón Jiménez 2020-02-04 03:28:47 +01:00
parent f5186f31f1
commit 6d46833eb2
12 changed files with 112 additions and 129 deletions

View file

@ -84,9 +84,9 @@ where
input(bump)
.attr("type", "checkbox")
.bool_attr("checked", self.is_checked)
.on("click", move |root, vdom, _event| {
.on("click", move |_root, vdom, _event| {
let msg = on_toggle(!is_checked);
event_bus.publish(msg, root);
event_bus.publish(msg);
vdom.schedule_render();
})