Rxjava: Why is there no share or publish/refcount for single?

Created on 19 Feb 2017  路  4Comments  路  Source: ReactiveX/RxJava

RX Java version 2.0.4 - Single doesn't have share/publish/refcount and therefore we can't have hot observables. Is there any reason for the same.

2.x Question

Most helpful comment

It has a cache operator and a SingleSubject to help with many cases when the single item should be cached. You can always convert back to Observable and have access to the publish and refCount operators.

All 4 comments

It has a cache operator and a SingleSubject to help with many cases when the single item should be cached. You can always convert back to Observable and have access to the publish and refCount operators.

Got it. Resolving.

I come back to the issue. Could we have more context about the "why" there is no "share" operator for single ? Even if we can maybe solve some requirement in another way. Is it by design decision ?

We limit the API surface of the library and the need for share in other types is rare.

Was this page helpful?
0 / 5 - 0 ratings