Manny
Manny

Reputation: 1034

rxjs forkJoin does not call subscribe

I have a set of RxJs Observable that uses forkJoin. The issue I have is that the forkJoin makes the calls but subscribe does not get calls.

However, if I use zip it works.

I have created an example in StackBlitz. Is this a bug or am I doing it all wrong?

Upvotes: 0

Views: 415

Answers (1)

bryan60
bryan60

Reputation: 29335

forkJoin only runs once all inner observables have completed. In your example, the inner observables never complete. zip runs once everytime all observables fire in order. If you want something to run anytime any observable fires, use combineLatest

Upvotes: 4

Related Questions