feat(Subscription): idempotent add and remove of teardowns#6401
Merged
benlesh merged 2 commits intoReactiveX:8.xfrom Sep 19, 2021
Merged
feat(Subscription): idempotent add and remove of teardowns#6401benlesh merged 2 commits intoReactiveX:8.xfrom
benlesh merged 2 commits intoReactiveX:8.xfrom
Conversation
- Adding the same instance of a teardown more than once is the same as adding it once - Removing a teardown with `Subscription.prototype.remove` will remove it much faster BREAKING CHANGE: Adding the same function instance to a subscription as a teardown multiple times will now result in that function being executed only once on teardown. This brings us inline with the behavior of EventTarget, and also makes removing teardowns faster. The workaround is to make sure you are adding a new function instance to the Subscription each time if you need the same effect. Resolves ReactiveX#6400
cartant
approved these changes
May 12, 2021
backbone87
reviewed
May 12, 2021
Member
Author
|
Changed the base to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Subscription.prototype.removewill remove it much fasterBREAKING CHANGE: Adding the same function instance to a subscription as a teardown multiple times will now result in that function being executed only once on teardown. This brings us inline with the behavior of EventTarget, and also makes removing teardowns faster. The workaround is to make sure you are adding a new function instance to the Subscription each time if you need the same effect.
Resolves #6400