wip: recoil
This commit is contained in:
1 parent
3cfa1fe125
commit
ee67654f58
31 files changed
+1369
-235
No files matched your search
@@ -0,0 +1,33 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use dioxus_core::prelude::*;
|
||||
use recoil::*;
|
||||
|
||||
const TODOS: AtomFamily<&str, Todo> = |_| HashMap::new();
|
||||
|
||||
#[derive(PartialEq)]
|
||||
struct Todo {
|
||||
checked: bool,
|
||||
contents: String,
|
||||
}
|
||||
|
||||
static App: FC<()> = |ctx, _| {
|
||||
rsx! { in ctx,
|
||||
div {
|
||||
"Basic Todolist with AtomFamilies in Recoil.rs"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static Child: FC<()> = |ctx, _| {
|
||||
// let todo = use_recoil_value(ctx, &TODOS);
|
||||
rsx! { in ctx,
|
||||
div {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
fn main() {
|
||||
wasm_bindgen_futures::spawn_local(dioxus_web::WebsysRenderer::start(App))
|
||||
}
|
||||
Reference in new issue
Block a user