5

Is there an empty Subscription in RxJs? In RxJava, there is Subscriptions.empty().

An empty Subscription is a Subscription to which unsubscribe does nothing except to change isUnsubscribed to true.

I am looking for it, but I can't find.

2 Answers 2

10

Yes such a thing exists:

RxJS 5 has Subscription.EMPTY

RxJS 4 has Disposable.empty

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Subscription.EMPTY is what i want. But Disposable.empty is not. It is not Subscription.
The nomenclature changed between versions 4 and 5. Subscription s used to be called Disposable s
1

Not sure what you want, but I can think about two things :

So both are empty in the sense that they do not emit any onNext message. However their completion semantics differ. Does that cover your use case?

1 Comment

Thanks! but this is not what i want.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.