feat: integrate fermi
This commit is contained in:
1 parent
3873cd1a60
commit
d461ffc011
23 files changed
+630
-15
No files matched your search
@@ -0,0 +1,53 @@
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
use dioxus::prelude::*;
|
||||
use fermi::*;
|
||||
|
||||
#[test]
|
||||
fn test_fermi() {
|
||||
let mut app = VirtualDom::new(App);
|
||||
app.rebuild();
|
||||
}
|
||||
|
||||
static TITLE: Atom<String> = |_| "".to_string();
|
||||
static USERS: AtomFamily<u32, String> = |_| Default::default();
|
||||
|
||||
fn App(cx: Scope) -> Element {
|
||||
cx.render(rsx!(
|
||||
Leaf { id: 0 }
|
||||
Leaf { id: 1 }
|
||||
Leaf { id: 2 }
|
||||
))
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Props)]
|
||||
struct LeafProps {
|
||||
id: u32,
|
||||
}
|
||||
|
||||
fn Leaf(cx: Scope<LeafProps>) -> Element {
|
||||
let user = use_read(&cx, TITLE);
|
||||
let user = use_read(&cx, USERS);
|
||||
|
||||
use_coroutine(&cx, || {
|
||||
//
|
||||
async move {
|
||||
//
|
||||
}
|
||||
});
|
||||
|
||||
rsx!(cx, div {
|
||||
button {
|
||||
onclick: move |_| {},
|
||||
"Start"
|
||||
}
|
||||
button {
|
||||
onclick: move |_| {},
|
||||
"Stop"
|
||||
}
|
||||
button {
|
||||
onclick: move |_| {},
|
||||
"Reverse"
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user