Skip to content
Discussion options

You must be logged in to vote
#[component]
pub fn App() -> impl IntoView {
    let (index, set_index) = create_signal(0);

    let handle = Interval::new(500, move || {
        set_index.update(|v| *v += 1);
        //  do something
    });
    on_cleanup(move || drop(handle));
    

   view! {
    .................
  }
}

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@gbj
Comment options

gbj Feb 17, 2024
Maintainer

@dvorakchen
Comment options

@ChocolateLoverRaj
Comment options

@gbj
Comment options

gbj Feb 22, 2024
Maintainer

Answer selected by dvorakchen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants