Skip to content

ReplaySubject and Filter, bug or feature? #4362

Closed
@Cher80

Description

@Cher80

Hi,
I have two subsribers for one ReplaySubject.
Subscriber1 filters emited objects for type 1 -- replaySubject.filter(1).subscribe()
Subscriber2 filters emited objects for type 2 -- replaySubject.filter(2).subscribe()

I emit from my ReplaySubject objects of types 1,1,1,1,2 (one on click)
Subscriber1 gets 1,1,1,1
then on the next click
Subscriber2 gets 2 and (!INTERSTING!) Subscriber1 gets 1,1,1,1 again.

Looks like there are some logic of ReplaySubject based on if onNext was called (on not called in case of filtering) and force ReplaySubject to reemit the objects
I can provide simplified code if needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions