Closed dragantl closed 8 years ago
The singleton instance of the transformer (aka instance()
) is itself a factory for instances of the actual operator. Each stream gets its own copy because each stream invokes the factory inside of the compose()
operator.
It's easy to write a test to prove the behavior: https://github.com/JakeWharton/RxReplayingShare/pull/8
ReplayingShare keeps track of a static instance. This instance then keeps track of the subscribers.
Am I correct to understand that this basically is limited to only one stream?
If I have a stream of clicks and a stream of ticks, I am unable to use this implementation for both, correct?
The syntax may be off but should convey a point. Won't ReplayingShare emit both clicks and ticks to both of the subscribers?