2021-07-09 05:26:15 +00:00
|
|
|
use dioxus_core::prelude::*;
|
2021-07-13 20:52:25 +00:00
|
|
|
|
2021-07-09 05:26:15 +00:00
|
|
|
fn main() {}
|
|
|
|
|
|
|
|
const App: FC<()> = |cx| {
|
2021-07-09 15:54:07 +00:00
|
|
|
// create a new future
|
2021-07-13 20:52:25 +00:00
|
|
|
let _fut = cx.use_hook(
|
2021-07-15 03:18:02 +00:00
|
|
|
|_| {
|
2021-07-09 05:26:15 +00:00
|
|
|
//
|
2021-07-09 15:54:07 +00:00
|
|
|
async { loop {} }
|
|
|
|
// Box::pin(async { loop {} }) as Pin<Box<dyn Future<Output = ()>>>
|
2021-07-09 05:26:15 +00:00
|
|
|
},
|
|
|
|
|f| f,
|
|
|
|
|_| {},
|
|
|
|
);
|
2021-07-09 15:54:07 +00:00
|
|
|
// let g = unsafe { Pin::new_unchecked(fut) };
|
2021-07-09 05:26:15 +00:00
|
|
|
|
2021-07-11 18:49:52 +00:00
|
|
|
// cx.submit_task(fut);
|
2021-07-09 07:39:45 +00:00
|
|
|
|
2021-07-09 05:26:15 +00:00
|
|
|
todo!()
|
|
|
|
};
|
2021-07-13 20:48:11 +00:00
|
|
|
|
|
|
|
const Task: FC<()> = |cx| {
|
2021-07-14 21:04:58 +00:00
|
|
|
let (task, res) = cx.use_task(|| async { true });
|
|
|
|
// task.pause();
|
|
|
|
// task.restart();
|
|
|
|
// task.stop();
|
|
|
|
// task.drop();
|
|
|
|
|
2021-07-13 20:48:11 +00:00
|
|
|
//
|
|
|
|
|
2021-07-13 20:52:25 +00:00
|
|
|
let _s = cx.use_task(|| async { "hello world".to_string() });
|
2021-07-13 20:48:11 +00:00
|
|
|
|
|
|
|
todo!()
|
|
|
|
};
|
|
|
|
|
2021-07-13 20:52:25 +00:00
|
|
|
fn use_mut<P, T>(_cx: Context<P>, _f: impl FnOnce() -> T) -> &mut T {
|
2021-07-13 20:48:11 +00:00
|
|
|
todo!()
|
|
|
|
}
|