Merge pull request #1300 from Demonthos/signals

Complete Signals implementation
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2023-08-11 13:05:04 -07:00
commit c95f70f55a
41 files changed
+2841 -423

No files matched your search

+1 -7
View File
@@ -1,17 +1,11 @@
//! Example: README.md showcase
//!
//! The example from the README.md.
use dioxus::prelude::*;
use dioxus_signals::{use_init_signal_rt, use_signal};
use dioxus_signals::use_signal;
fn main() {
dioxus_desktop::launch(app);
}
fn app(cx: Scope) -> Element {
use_init_signal_rt(cx);
let mut count = use_signal(cx, || 0);
use_future!(cx, || async move {
+1 -1
View File
@@ -20,7 +20,7 @@ fn app(cx: Scope) -> Element {
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
if count() > 5 {
if count.value() > 5 {
rsx!{ h2 { "High five!" } }
}
})