lastValueFrom unreliable when refresh page

Discussão em 'Angular' iniciado por MartinaAnt, Novembro 13, 2024.

  1. MartinaAnt

    MartinaAnt Guest

    I have an Angular/Django app where, when I repeatedly refresh a page, in about 10% of cases, the result of lastValueFrom is empty. However, the rest of the time, I can see the correct data.

    Here’s my code:

    async ngOnInit() {
    this.goals$ = this.store.select(state => state.shortGoals.shortGoals);
    this.goals = await lastValueFrom(this.goals$.pipe(take(1)));


    I have tried using delay, retry, and timeout, as well as a resolver, but the issue persists.

    Continue reading...

Compartilhe esta Página