You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constreplaySubject=newReplaySubject<void>(1);// At some later pointreplaySubject.next();
Expected behavior: I can call next() without any arguments since the subject is a void type.
Actual behavior: I have to call next() with undefined or null to signal that something has happened to the replay subject.
Additional information: Essentially I want to use a replay subject to indicate whether something has happened. I need to use a ReplaySubject so that new subscribers connecting can know whether the subject has emitted in the past, but the value that subject emits is irrelevant to any subscribers (hence using a void replay subject).
This behaviour seems at odds with how Subject works and their implementation of next() differs. I noticed that this behaviour was changed here: #1728, but am unsure whether my proposed change will be accepted given this issue: #2852
I will be happy to submit a PR for this if this change would be accepted.
The text was updated successfully, but these errors were encountered:
As discussed in #3074, we will wait for upstream change microsoft/TypeScript#12400 (comment) to properly support behavior around those. We probably won't going to introduce interim changes until then as it may break between changes we introduce.
RxJS version: 5.5.6
Code to reproduce:
Expected behavior: I can call
next()
without any arguments since the subject is avoid
type.Actual behavior: I have to call
next()
withundefined
ornull
to signal that something has happened to the replay subject.Additional information: Essentially I want to use a replay subject to indicate whether something has happened. I need to use a ReplaySubject so that new subscribers connecting can know whether the subject has emitted in the past, but the value that subject emits is irrelevant to any subscribers (hence using a void replay subject).
This behaviour seems at odds with how
Subject
works and their implementation ofnext()
differs. I noticed that this behaviour was changed here: #1728, but am unsure whether my proposed change will be accepted given this issue: #2852I will be happy to submit a PR for this if this change would be accepted.
The text was updated successfully, but these errors were encountered: