Closed bordoley closed 8 years ago
Rather than removing this, do you think we could fix it? Is it worth fixing?
I don't think you can sanely fix the api. Consider an IObservable of mouse events or really any hot observable. What does it mean to be empty? Does empty really mean completed, and during the time I was observing it, no events were generated?
Good point
The implementation should have called Observable.IsEmpty
from System.Reactive.Linq
The docstring for isEmpty
should be more clear stating
/// isEmpty returns an Observable that emits true if and only if the source
/// Observable completes without emitting any items.
@cloudRoutine good call on changing the method signature to return an observable. That makes sense. Thanks.
This method is dubious at best. The current implementation does a reference compare to the object returned by Observable.Empty() afaict.
For instance this could easily result in a false result if an Observable was created from an empty array, or if the implementation of Observable.Empty() was changed not to return a singleton instance.