feat: dedicated mutations module

This commit is contained in:
Jonathan Kelley committed 2021-08-22 17:08:25 -04:00
1 parent 1622f484b3
commit db6d0184aa
17 files changed
+610 -515

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
//! Diffing is interruptible, but uses yield_now which is loop-pollable
//!
//! This means you can actually call it synchronously if you want.
use anyhow::{Context, Result};
use dioxus::{
arena::SharedResources,
diff::{CreateMeta, DiffInstruction, DiffMachine},
prelude::*,
scope::Scope,
};
use dioxus_core as dioxus;
use dioxus_html as dioxus_elements;
use futures_util::FutureExt;
#[test]
fn worksync() {
static App: FC<()> = |cx| {
cx.render(rsx! {
div {"hello"}
})
};
let mut dom = VirtualDom::new(App);
let mut fut = dom.rebuild_async().boxed_local();
let mutations = loop {
let g = (&mut fut).now_or_never();
if g.is_some() {
break g.unwrap().unwrap();
}
};
dbg!(mutations);
}