Skip to content
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

Unsubscribed Subjects should throw ObjectDisposedError if next, error or complete is called. #859

Closed
mattpodwysocki opened this issue Dec 1, 2015 · 2 comments
Labels
help wanted Issues we wouldn't mind assistance with.
Milestone

Comments

@mattpodwysocki
Copy link
Collaborator

In the current version of RxJS v4, we check for disposal with Disposable.checkDisposed so any subsequent call to onNext, onError and onCompleted and even subscribe are guarded by throwing a specific error of ObjectDisposedError.

In RxJS v5, there is a change to simply return and do nothing in the Subject, is this intentional and if so why? Yes, I realize this follows RxJava instead of RxJS, but at least what thought went into this would be good to know.

cc @benjchristensen @headinthebox

(EDIT (@Blesh): updated link to "modern" equivalent of what was linked, and pinned it to a SHA)

@benlesh
Copy link
Member

benlesh commented Dec 1, 2015

is this intentional and if so why?

It's not intentional, as far as I can remember. I've actually just added an ObjectUnsubscribedError per conversation on #853

benlesh added a commit that referenced this issue Dec 8, 2015
this class was added to support throwing errors when members of Subjects were accessed in invalid ways after the Subject has been unsubscribed

related #859
related #758
@benlesh benlesh added help wanted Issues we wouldn't mind assistance with. priority: low and removed type: discussion labels Jan 15, 2016
@benlesh benlesh added this to the 5.0.0-beta.2 milestone Jan 15, 2016
@benlesh benlesh changed the title Should Subjects throw on member calls after unsubscription? Unsubscribed Subjects should throw ObjectDisposedError if next, error or complete is called. Jan 15, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Feb 8, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Feb 8, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Feb 8, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Feb 8, 2016
@benlesh benlesh closed this as completed in 29b630b Feb 9, 2016
@lock
Copy link

lock bot commented Jun 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Issues we wouldn't mind assistance with.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants