only implement T -> Readonlysignal
This commit is contained in:
1 parent
1c67585ba2
commit
1f88103dca
4 files changed
+26
-15
No files matched your search
+2
-4
@@ -59,15 +59,13 @@ fn app() -> Element {
|
||||
}
|
||||
|
||||
// You can pass a value directly to any prop that accepts a signal
|
||||
Child { count: 0 }
|
||||
Child { count: doubled_count() }
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn Child(mut count: Signal<i32>) -> Element {
|
||||
fn Child(mut count: ReadOnlySignal<i32>) -> Element {
|
||||
rsx! {
|
||||
h1 { "{count}" }
|
||||
button { onclick: move |_| count += 1, "Up high!" }
|
||||
button { onclick: move |_| count -= 1, "Down low!" }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user