Skip to content

Commit

Permalink
chore: fix ssr example
Browse files Browse the repository at this point in the history
  • Loading branch information
brofrain committed Oct 27, 2023
1 parent 2dc6af4 commit b5cc94a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/ssr/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ const INITIAL_ITEM_COUNT: usize = 40;

#[component]
fn Home() -> impl IntoView {
let last_added_item = StoredValue::new(INITIAL_ITEM_COUNT - 1);
let next_item = StoredValue::new(INITIAL_ITEM_COUNT);

let items = RwSignal::new((0..INITIAL_ITEM_COUNT).collect::<Vec<_>>());

let create_new_item = Callback::new(move |()| {
let item = last_added_item();
last_added_item.set_value(item + 1);
let item = next_item();
next_item.set_value(item + 1);
item
});

Expand Down

0 comments on commit b5cc94a

Please sign in to comment.