Additional Information
AsyncSubject allows you to emit the saved value within the AsyncSubject only when it's been given the complete signal.
Therefore, I could be spamming values into an AsyncSubject, and it won't emit a value until I explicitly send the complete signal to the AsyncSubject. Therefore, it's like a BehaviorSubject (it stores state internally), but it will only emit once you explicitly tell it to.
I don't see where / why I would ever need to use this variant of subject.
The above statement is like asking why would you use a wrench, when you could use a socket wrench. AsyncSubject is just another tool in your toolbelt. You can use it to solve specific problems, and you as the operator get to choose which tool best fits the current problem that you're trying to solve.
AsyncSubject StackBlitz Example
AsyncSubject
exists to facilitate the implementation ofpublishLast
. Perhaps it's easier to see a use case for that? – Ingles