diff --git a/src/main.rs b/src/main.rs index 066bcd6..1f3e862 100644 --- a/src/main.rs +++ b/src/main.rs @@ -141,10 +141,6 @@ fn App(examples: examples::Examples, ); - let names: StoredValue> = - store_value(examples.keys().cloned().collect()); - - let key_handle = window_event_listener(ev::keypress, move |ev| { if ev.key() == "s" { searchbar_focus.set(true); @@ -154,15 +150,21 @@ fn App(examples: examples::Examples, let examples_list: Vec> = examples.values().cloned().collect(); + let names : Vec<_> = examples.keys().cloned().collect(); + + let set_name = Callback::new(move |i| { + set_current_name(names[i]) + }); + view!{

Leptos by example

-
- +
+ {current_name}