The Observer
is being automatically disposed when it receives a call to OnComplete
. This is actually a very good pattern, as it means you don't have to manually dispose of Subscription
s like this:
Observable.Range(0, 100)
.Subscribe(...);
or
Observable.Interval(TimeSpan.FromSeconds(1))
.Take(10)
.Subscribe();
So, to make sure your observer doesn't get disposed until it wants to be disposed, you can concat another empty, never completing, observable to your source.
IObservable<Book> observable = query.ToObservable()
.Concat(Observable.Never<Book>());
However, depending on what you're attempting to do, it may be better to handle this elsewhere, such as the client.