Skip to content

Commit

Permalink
chore: add implementation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Nov 27, 2019
1 parent 5cc2e7a commit 718daa7
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/internal/operators/catchError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ class CatchSubscriber<T, R> extends OuterSubscriber<T, T | R> {
const innerSubscriber = new InnerSubscriber(this, undefined, undefined);
this.add(innerSubscriber);
const innerSubscription = subscribeToResult(this, result, undefined, undefined, innerSubscriber);
// The returned subscription will usually be the subscriber that was
// passed. However, interop subscribers will be wrapped and for
// unsubscriptions to chain correctly, the wrapper needs to be added, too.
if (innerSubscription !== innerSubscriber) {
this.add(innerSubscription);
}
Expand Down
3 changes: 3 additions & 0 deletions src/internal/operators/exhaustMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ class ExhaustMapSubscriber<T, R> extends OuterSubscriber<T, R> {
const destination = this.destination as Subscription;
destination.add(innerSubscriber);
const innerSubscription = subscribeToResult<T, R>(this, result, undefined, undefined, innerSubscriber);
// The returned subscription will usually be the subscriber that was
// passed. However, interop subscribers will be wrapped and for
// unsubscriptions to chain correctly, the wrapper needs to be added, too.
if (innerSubscription !== innerSubscriber) {
destination.add(innerSubscription);
}
Expand Down
3 changes: 3 additions & 0 deletions src/internal/operators/mergeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ export class MergeMapSubscriber<T, R> extends OuterSubscriber<T, R> {
const destination = this.destination as Subscription;
destination.add(innerSubscriber);
const innerSubscription = subscribeToResult<T, R>(this, ish, undefined, undefined, innerSubscriber);
// The returned subscription will usually be the subscriber that was
// passed. However, interop subscribers will be wrapped and for
// unsubscriptions to chain correctly, the wrapper needs to be added, too.
if (innerSubscription !== innerSubscriber) {
destination.add(innerSubscription);
}
Expand Down
3 changes: 3 additions & 0 deletions src/internal/operators/mergeScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ export class MergeScanSubscriber<T, R> extends OuterSubscriber<T, R> {
const destination = this.destination as Subscription;
destination.add(innerSubscriber);
const innerSubscription = subscribeToResult<T, R>(this, ish, undefined, undefined, innerSubscriber);
// The returned subscription will usually be the subscriber that was
// passed. However, interop subscribers will be wrapped and for
// unsubscriptions to chain correctly, the wrapper needs to be added, too.
if (innerSubscription !== innerSubscriber) {
destination.add(innerSubscription);
}
Expand Down
3 changes: 3 additions & 0 deletions src/internal/operators/onErrorResumeNext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ class OnErrorResumeNextSubscriber<T, R> extends OuterSubscriber<T, R> {
const destination = this.destination as Subscription;
destination.add(innerSubscriber);
const innerSubscription = subscribeToResult(this, next, undefined, undefined, innerSubscriber);
// The returned subscription will usually be the subscriber that was
// passed. However, interop subscribers will be wrapped and for
// unsubscriptions to chain correctly, the wrapper needs to be added, too.
if (innerSubscription !== innerSubscriber) {
destination.add(innerSubscription);
}
Expand Down
3 changes: 3 additions & 0 deletions src/internal/operators/skipUntil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ class SkipUntilSubscriber<T, R> extends OuterSubscriber<T, R> {
this.add(innerSubscriber);
this.innerSubscription = innerSubscriber;
const innerSubscription = subscribeToResult(this, notifier, undefined, undefined, innerSubscriber);
// The returned subscription will usually be the subscriber that was
// passed. However, interop subscribers will be wrapped and for
// unsubscriptions to chain correctly, the wrapper needs to be added, too.
if (innerSubscription !== innerSubscriber) {
this.add(innerSubscription);
this.innerSubscription = innerSubscription;
Expand Down
3 changes: 3 additions & 0 deletions src/internal/operators/switchMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ class SwitchMapSubscriber<T, R> extends OuterSubscriber<T, R> {
const destination = this.destination as Subscription;
destination.add(innerSubscriber);
this.innerSubscription = subscribeToResult(this, result, undefined, undefined, innerSubscriber);
// The returned subscription will usually be the subscriber that was
// passed. However, interop subscribers will be wrapped and for
// unsubscriptions to chain correctly, the wrapper needs to be added, too.
if (this.innerSubscription !== innerSubscriber) {
destination.add(this.innerSubscription);
}
Expand Down

0 comments on commit 718daa7

Please sign in to comment.