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

+1 -1
View File
@@ -12,7 +12,7 @@ pub static App: FC<()> = |cx| {
let mut direction = use_state(cx, || 1);
let (async_count, dir) = (count.for_async(), *direction);
let (task, _result) = cx.use_task(move || async move {
let (task, _result) = use_task(cx, move || async move {
loop {
gloo_timers::future::TimeoutFuture::new(250).await;
*async_count.get_mut() += dir;