1
Por que setTimeout () torna meu aplicativo lento, mas o Rxjs timer (). Subscribe (…) não?
Eu tenho um componente, que "carrega preguiçosamente" alguns comentários, no intervalo de 100ms. Quando eu uso o setTimeout, é realmente lento. componente <div *ngFor="let post of posts"> <app-post [post]="post" ></app-post> </div> Isso torna meu aplicativo lento (avg fps 14, tempo ocioso 51100ms): while(this.postService.hasPosts()){ setTimeout(()=> { this.posts.push(this.postService.next(10)); },100); } Isso torna …