From a82af6110fbfc9fe312edf9587026317f980e4dd Mon Sep 17 00:00:00 2001 From: Adrian <60581773+solweo@users.noreply.github.com> Date: Fri, 5 Apr 2024 06:09:55 +0300 Subject: [PATCH] ex: counter_url_query; to stable (#2499) --- examples/counter_url_query/Cargo.toml | 2 +- examples/counter_url_query/rust-toolchain.toml | 2 +- examples/counter_url_query/src/lib.rs | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/counter_url_query/Cargo.toml b/examples/counter_url_query/Cargo.toml index 743c848aa5..8bfa95fb56 100644 --- a/examples/counter_url_query/Cargo.toml +++ b/examples/counter_url_query/Cargo.toml @@ -8,7 +8,7 @@ codegen-units = 1 lto = true [dependencies] -leptos = { path = "../../leptos", features = ["csr", "nightly"] } +leptos = { path = "../../leptos", features = ["csr"] } leptos_router = { path = "../../router", features = ["csr"] } console_log = "1" log = "0.4" diff --git a/examples/counter_url_query/rust-toolchain.toml b/examples/counter_url_query/rust-toolchain.toml index 99fa95aaaf..292fe499e3 100644 --- a/examples/counter_url_query/rust-toolchain.toml +++ b/examples/counter_url_query/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-03-31" +channel = "stable" diff --git a/examples/counter_url_query/src/lib.rs b/examples/counter_url_query/src/lib.rs index 39165f3df2..f4f4ff3b05 100644 --- a/examples/counter_url_query/src/lib.rs +++ b/examples/counter_url_query/src/lib.rs @@ -7,17 +7,17 @@ use leptos_router::*; #[component] pub fn SimpleQueryCounter() -> impl IntoView { let (count, set_count) = create_query_signal::("count"); - let clear = move |_| set_count(None); - let decrement = move |_| set_count(Some(count().unwrap_or(0) - 1)); - let increment = move |_| set_count(Some(count().unwrap_or(0) + 1)); + let clear = move |_| set_count.set(None); + let decrement = move |_| set_count.set(Some(count.get().unwrap_or(0) - 1)); + let increment = move |_| set_count.set(Some(count.get().unwrap_or(0) + 1)); let (msg, set_msg) = create_query_signal::("message"); let update_msg = move |ev| { let new_msg = event_target_value(&ev); if new_msg.is_empty() { - set_msg(None); + set_msg.set(None); } else { - set_msg(Some(new_msg)); + set_msg.set(Some(new_msg)); } }; @@ -25,13 +25,13 @@ pub fn SimpleQueryCounter() -> impl IntoView {
- "Value: " {move || count().unwrap_or(0)} "!" + "Value: " {move || count.get().unwrap_or(0)} "!"