Skip to content

Commit

Permalink
chore(shareReplay): remove redundant variable isComplete (#5458)
Browse files Browse the repository at this point in the history
  • Loading branch information
josepot authored May 27, 2020
1 parent e1d8da9 commit 9efc3d5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/internal/operators/shareReplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ function shareReplayOperator<T>({
let refCount = 0;
let subscription: Subscription | undefined;
let hasError = false;
let isComplete = false;

return function shareReplayOperation(this: Subscriber<T>, source: Observable<T>) {
refCount++;
Expand All @@ -166,7 +165,6 @@ function shareReplayOperator<T>({
subject!.error(err);
},
complete() {
isComplete = true;
subscription = undefined;
subject!.complete();
},
Expand All @@ -177,7 +175,7 @@ function shareReplayOperator<T>({
this.add(() => {
refCount--;
innerSub.unsubscribe();
if (subscription && !isComplete && useRefCount && refCount === 0) {
if (subscription && useRefCount && refCount === 0) {
subscription.unsubscribe();
subscription = undefined;
subject = undefined;
Expand Down

0 comments on commit 9efc3d5

Please sign in to comment.