[WIP] fix: ensure all interop operators are chained correctly #5243
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.
WIP:
#5333 is likely a better solution to the problem.
Description:
This PR refactors the fix in #5239 so that it can be applied to all operators - or at least to those that need unsubscription to be chained.
The problem is outlined in the linked issue, but AFAICT the problem is not specific to the
finalize
operator. For example, thebuffer
operator's subscriber adds a subscription that depends upon unsubscription being chained correctly:rxjs/src/internal/operators/buffer.ts
Lines 73 to 76 in 56e7ceb
And
windowTime
adds scheduled actions:rxjs/src/internal/operators/windowTime.ts
Lines 189 to 206 in 56e7ceb
IMO, all operator subscriptions made within an operator's
call
method should be made usingsubscribeAndChainOperator
.ATM, this PR's branch is based on #5239, so it includes that PR's commits. The last two commits are the changes introduced in this PR.
Related issue (if exists): #5239