-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
observers
should be private on Subjects.
#5967
Comments
After talking with @leggechr, I think so many people are using |
Seems deprecated right now in v7 (without any notice in the changelog or documentation in the 6-7 change summary document: https://github.com/ReactiveX/rxjs/blob/master/src/internal/Subject.ts#L18:L19 Is there an associated api recommend for the common use case of:
It is hard to imagine any other reasonable use case. |
I would imagine the introduction of an |
I'm using following construction to check whether I can close an observed connection via sse (user could have multiple browser tabs opened and connected).
Seems like isObserved wouldn't do it for me. Are there any workarounds for such a case? |
I find this property useful for unit test to check the subscriber count. Is there another recommended way to check subscriber count for test if this is deprecated? |
I just found out this is going to be killed in the future. I was trying to build an operator that only emits to the last registered observer. Is there another way to do it? This would be the exact example of it:
|
I've just seen this deprecation, we too do the old So if this is to be removed, we definitely need a solution for this problem. For us, the "isObserved" proposal would work fine. -EDIT- Oh I've just seen a note that said "use I checked and ie. this problem has been solved and this issue could perhaps be closed (with the exception of dmitrii334's problem of checking if it's < 2) ? |
@sam-s4s in general, anything related to getting the observers. I was thinking that maybe a |
That could be a possibility. I'm not entirely sure why there seems to be this hidden rule to obfuscate the inner workings of rxjs objects. Sometimes you need to create wrapper objects to keep track of things, and I'm not sure why this can't just be a feature of the library. |
It was never meant as a means of introspecting or mutating what was going on within a Subject. IIRC, it was left
public
>6 years ago so we could access it within our own tests. That it was ever public is unfortunate.Related #5961
The text was updated successfully, but these errors were encountered: