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

@ -93,10 +93,8 @@ where
.attr("type", "radio")
.attr("style", "margin-right: 10px")
.bool_attr("checked", self.is_selected)
.on("click", move |root, vdom, _event| {
event_bus.publish(on_click.clone(), root);
vdom.schedule_render();
.on("click", move |_root, _vdom, _event| {
event_bus.publish(on_click.clone());
})
.finish(),
text(radio_label.into_bump_str()),