I\'m trying to trigger a callback when all my observables are executed. In my other, older project i used finally
like so and that worked like a charm:
If you want to do something when the observable completes then use the complete callback instead of finally/finalize:
.subscribe(
value => { console.log(`Next: ${value}`); },
error => { console.log(`Error: ${error}`); },
() => { console.log(`Completed`); }
);
Anyway finally/finalize should also work and will be called on error OR complete. Im pretty sure that your observable never completes. You can confirm this by using my code above.
I see you are using Angular and subscribing to this.route.queryParams
which never completes. You may create a new observable by use of first()
so you get the value and it immediatly completes: this.route.queryParams.pipe(first())