feat: make hooks free-functions

This commit is contained in:
Jonathan Kelley committed 2021-07-27 11:28:05 -04:00
1 parent f782e14211
commit e5c88fe3a4
13 files changed
+373 -323

No files matched your search

+2 -2
View File
@@ -21,7 +21,7 @@ const App: FC<()> = |cx| {
};
const Task: FC<()> = |cx| {
let (task, res) = cx.use_task(|| async { true });
let (task, res) = use_task(cx, || async { true });
// task.pause();
// task.restart();
// task.stop();
@@ -29,7 +29,7 @@ const Task: FC<()> = |cx| {
//
let _s = cx.use_task(|| async { "hello world".to_string() });
let _s = use_task(cx, || async { "hello world".to_string() });
todo!()
};
+2 -1
View File
@@ -4,7 +4,8 @@ use dioxus_core::prelude::*;
fn App(cx: Context<()>) -> DomTree {
//
let vak = cx.use_suspense(
let vak = use_suspense(
cx,
|| async {},
|c, res| {
//