Somewhere in my application, I have a function that must return an Observable. Most of the time, this works fine, but there is an instance where it's not really possible to provide a meaningful result. If this is the case, the caller won't do anything with the result either.
Because it doesn't really matter what the result is, I return new Observable()
here. If I return nothing (like return;
), I get an error so I must return an Observable.
The thing I'm worried about is making Observables like these that never complete. At the end of an Observable's lifespan, subscriber.complete()
is used to indicate the Observable isn't going to do anything anymore. If I don't do that, will this result in any serious problems, like memory leaks?