implement for web and desktop

This commit is contained in:
= committed 2022-12-15 21:16:37 -06:00
1 parent ab743e01b7
commit 0d9c350d5e
8 files changed
+69 -30

No files matched your search

+9 -5
View File
@@ -202,19 +202,23 @@ pub async fn run_with_props<T: 'static>(root: fn(Scope<T>) -> Element, root_prop
// if virtualdom has nothing, wait for it to have something before requesting idle time
// if there is work then this future resolves immediately.
let mut res = {
let (mut res, template) = {
let work = dom.wait_for_work().fuse();
pin_mut!(work);
futures_util::select! {
_ = work => None,
_new_template = hotreload_rx.next() => {
todo!("Implement hot reload");
_ = work => (None, None),
new_template = hotreload_rx.next() => {
(None, new_template)
}
evt = rx.next() => evt
evt = rx.next() => (evt, None)
}
};
if let Some(template) = template {
dom.replace_template(template);
}
// Dequeue all of the events from the channel in send order
// todo: we should re-order these if possible
while let Some(evt) = res {