fix use_effect_with_deps

This commit is contained in:
Jonathan Kelley committed 2024-02-02 14:49:33 -08:00
1 parent e8182b105e
commit 6bde8b0ce0
2 files changed
+31 -4

No files matched your search

+5
View File
@@ -9,6 +9,11 @@ fn main() {
fn app() -> Element {
let mut count = use_signal(|| 0);
let g: ReadOnlySignal<(), UnsyncStorage> =
use_maybe_sync_selector_with_dependencies((&(count())), move |deps| {
println!("High-Five counter: {}", deps);
});
rsx! {
h1 { "High-Five counter: {count}" }
button { onclick: move |_| count += 1, "Up high!" }