port examples to new events

This commit is contained in:
Evan Almloff committed 2023-09-01 15:38:55 -05:00
1 parent dee92b83be
commit df222c121a
25 files changed
+55 -41

No files matched your search

+8 -1
View File
@@ -56,7 +56,14 @@ fn events_generate() {
let mut dom = VirtualDom::new(app);
_ = dom.rebuild();
dom.handle_event("click", Rc::new(MouseData::default()), ElementId(1), true);
dom.handle_event(
"click",
Rc::new(PlatformEventData::new(Box::new(MouseData::new(
SerializedMouseData::default(),
)))),
ElementId(1),
true,
);
dom.mark_dirty(ScopeId(0));
let edits = dom.render_immediate();
+8 -1
View File
@@ -9,7 +9,14 @@ fn miri_rollover() {
_ = dom.rebuild();
for _ in 0..3 {
dom.handle_event("click", Rc::new(MouseData::default()), ElementId(2), true);
dom.handle_event(
"click",
Rc::new(PlatformEventData::new(Box::new(MouseData::new(
SerializedMouseData::default(),
)))),
ElementId(2),
true,
);
dom.process_events();
_ = dom.render_immediate();
}
+1 -1
View File
@@ -36,7 +36,7 @@ fn suspended_child(cx: Scope) -> Element {
cx.spawn(async move {
val += 1;
});
return cx.suspend()?;
cx.suspend()?;
}
render!("child")