Skip to content

Commit

Permalink
chore: update syntax in README example (#3611)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfrances107 authored Feb 15, 2025
1 parent 04cb036 commit a9f27d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use leptos::*;
#[component]
pub fn SimpleCounter(initial_value: i32) -> impl IntoView {
// create a reactive signal with the initial value
let (value, set_value) = create_signal(initial_value);
let (value, set_value) = signal(initial_value);

// create event handlers for our buttons
// note that `value` and `set_value` are `Copy`, so it's super easy to move them into closures
Expand All @@ -46,7 +46,7 @@ pub fn SimpleCounter(initial_value: i32) -> impl IntoView {
pub fn SimpleCounterWithBuilder(initial_value: i32) -> impl IntoView {
use leptos::html::*;

let (value, set_value) = create_signal(initial_value);
let (value, set_value) = signal(initial_value);
let clear = move |_| set_value(0);
let decrement = move |_| set_value.update(|value| *value -= 1);
let increment = move |_| set_value.update(|value| *value += 1);
Expand Down

0 comments on commit a9f27d6

Please sign in to comment.