async.rs 315 B

123456789101112131415
  1. use dioxus_core::prelude::*;
  2. fn main() {
  3. let mut dom = VirtualDom::new(App);
  4. dom.rebuild();
  5. }
  6. const App: FC<()> = |cx, props| {
  7. let id = cx.scope_id();
  8. cx.submit_task(Box::pin(async move { id }));
  9. let (handle, contents) = use_task(cx, || async { "hello world".to_string() });
  10. todo!()
  11. };