dioxus/packages/core/examples/async.rs

16 lines
317 B
Rust
Raw Normal View History

use dioxus_core::prelude::*;
2021-07-13 20:52:25 +00:00
2021-09-22 05:25:28 +00:00
fn main() {
let mut dom = VirtualDom::new(App);
dom.rebuild();
}
2021-10-16 21:37:28 +00:00
const App: FC<()> = |(cx, props)| {
2021-09-22 05:25:28 +00:00
let id = cx.scope_id();
cx.submit_task(Box::pin(async move { id }));
2021-07-13 20:48:11 +00:00
2021-09-22 05:25:28 +00:00
let (handle, contents) = use_task(cx, || async { "hello world".to_string() });
2021-07-13 20:48:11 +00:00
todo!()
};