Reputation: 325
I want to subscribe to an observable, but right after the first element, I want to dispose the subscriber.
Is there some default way for that?
If not, how would you solve this? I cannot change the observable, by the way.
Upvotes: 3
Views: 4354
Reputation: 763
just use take operator :)
yourObservable.take(1).subscribe(....
Upvotes: 8