1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Typescript rxjs : is there any clean alternative to setimeout 0

Discussão em 'Angular' iniciado por firasKoubaa, Outubro 17, 2024 às 13:53.

  1. firasKoubaa

    firasKoubaa Guest

    Withing my angular app , I'm using this kind of treatment

    myMethod(){
    ...
    setTimeout(() => {
    this.router.navigate(['mucomponent']);
    });
    }


    As I was told : setTimeout without a delay (0) seems to wait the next tick where all treatments are done to begin my treament. it's a planification for the near future.

    Since I need this behaviour

    Is there any clean alternative to do it the same with typescript or rxjs to do it better ?

    Suggestions ?

    Continue reading...

Compartilhe esta Página