Friday, March 25, 2022

rxjs EMPTY

I know the blog is technically called "Answers I Couldn't Find Anywhere Else" and I did find this answer somewhere else, but it's a very valuable answer that I want to keep for future reference. 

This other blog helped me understand what was going on with my unit tests and why forkJoin wasn't being triggered when I used EMPTY.

The TL;DR of it is that EMPTY immediately emits a complete without ever emitting a value, but forkJoin fires when all observables emit their value. Since EMPTY never emits a value, forkJoin never fires. Simple as that.