wip: changes to scheduler
This commit is contained in:
1 parent
b32e2611e3
commit
098d3821ed
14 files changed
+151
-282
No files matched your search
@@ -1,8 +1,12 @@
|
||||
use dioxus_core::prelude::*;
|
||||
|
||||
fn main() {}
|
||||
fn main() {
|
||||
let mut dom = VirtualDom::new(EXAMPLE);
|
||||
dom.rebuild();
|
||||
println!("{}", dom);
|
||||
}
|
||||
|
||||
pub static Example: FC<()> = |cx, props| {
|
||||
pub static EXAMPLE: FC<()> = |cx, _| {
|
||||
let list = (0..10).map(|_f| LazyNodes::new(move |_f| todo!()));
|
||||
|
||||
cx.render(LazyNodes::new(move |cx| {
|
||||
|
||||
@@ -1,39 +1,15 @@
|
||||
use dioxus_core::prelude::*;
|
||||
|
||||
fn main() {}
|
||||
fn main() {
|
||||
let mut dom = VirtualDom::new(App);
|
||||
dom.rebuild();
|
||||
}
|
||||
|
||||
const App: FC<()> = |cx, props| {
|
||||
// create a new future
|
||||
let _fut = cx.use_hook(
|
||||
|_| {
|
||||
//
|
||||
async { loop {} }
|
||||
// Box::pin(async { loop {} }) as Pin<Box<dyn Future<Output = ()>>>
|
||||
},
|
||||
|f| f,
|
||||
|_| {},
|
||||
);
|
||||
// let g = unsafe { Pin::new_unchecked(fut) };
|
||||
let id = cx.scope_id();
|
||||
cx.submit_task(Box::pin(async move { id }));
|
||||
|
||||
// cx.submit_task(fut);
|
||||
let (handle, contents) = use_task(cx, || async { "hello world".to_string() });
|
||||
|
||||
todo!()
|
||||
};
|
||||
|
||||
const Task: FC<()> = |cx, props| {
|
||||
let (_task, _res) = use_task(cx, || async { true });
|
||||
// task.pause();
|
||||
// task.restart();
|
||||
// task.stop();
|
||||
// task.drop();
|
||||
|
||||
//
|
||||
|
||||
let _s = use_task(cx, || async { "hello world".to_string() });
|
||||
|
||||
todo!()
|
||||
};
|
||||
|
||||
fn use_mut<P, T>(_cx: Context, _f: impl FnOnce() -> T) -> &mut T {
|
||||
todo!()
|
||||
}
|
||||
Reference in new issue
Block a user