Why would you ever subscribe to or even create an observable that never yields anything, not even an error, nor completion?
It is a fundamental "atom" in the composition of observable event streams and comes up in a variety of situations - but one of the most common uses for Observable.Never in practice is in writing tests. It easily enables robust checking of timeout logic, for example - and is often combined with the TestScheduler or other virtual time schedulers in test scenarios. If you examine the source code of Rx itself, you find it appears in many unit tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With