From 0596e53eb5a35b46e1047a6c54723ebeede6fbc1 Mon Sep 17 00:00:00 2001 From: Anatol Ulrich <45840+spookyvision@users.noreply.github.com> Date: Wed, 18 Dec 2024 00:18:26 +0100 Subject: [PATCH] fix peek() example (#3375) Co-authored-by: Anatol Ulrich --- packages/signals/src/read.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/signals/src/read.rs b/packages/signals/src/read.rs index baae79773..eec8de7a4 100644 --- a/packages/signals/src/read.rs +++ b/packages/signals/src/read.rs @@ -139,8 +139,8 @@ pub trait Readable { /// let doubled = use_memo(move || { /// // We want to log the value of the event_source, but we don't need to rerun the doubled value if the event_source changes (because the value of doubled doesn't depend on the event_source) /// // We can read the value with peek without subscribing to updates - /// let click_count = count.peek(); - /// tracing::info!("Click count: {click_count:?}"); + /// let source = event_source.peek(); + /// tracing::info!("Clicked: {source:?}"); /// count() * 2 /// }); /// rsx! { @@ -149,6 +149,7 @@ pub trait Readable { /// button { /// onclick: move |_| { /// event_source.set(Some("Click me button")); + /// count += 1; /// }, /// "Click me" /// }