wip: changes to scheduler

This commit is contained in:
Jonathan Kelley committed 2021-09-22 01:25:28 -04:00
1 parent b32e2611e3
commit 098d3821ed
14 files changed
+151 -282

No files matched your search

+6 -2
View File
@@ -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| {
+7 -31
View File
@@ -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!()
}