diff --git a/examples/iter.rs b/examples/iter.rs index 9661634..61162ca 100644 --- a/examples/iter.rs +++ b/examples/iter.rs @@ -16,23 +16,15 @@ pub fn app(screen: Arc) -> Rsx { let count = use_state(1); run! { - ref count { + ref count, items { loop { - if count.get_dl() == 20 { - break; - } - std::thread::sleep(std::time::Duration::from_millis(200)); + items.get().push(count.get_dl()); **count.get() += 1; + std::thread::sleep(std::time::Duration::from_millis(100)); } } } - run! { - use count ref items { - items.get().push(count.get_dl()); - } - } - rsx! { @AlwaysFocused; @Handler::new({