From d76fa4b89482bd8cf9ce00c03e2fbf0fec5615c6 Mon Sep 17 00:00:00 2001 From: Josep M Sobrepere Date: Tue, 26 May 2020 09:51:41 +0200 Subject: [PATCH] chore(shareReplay): remove redundant variable `isComplete` --- src/internal/operators/shareReplay.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/internal/operators/shareReplay.ts b/src/internal/operators/shareReplay.ts index 8ebad05f53..935e73beb6 100644 --- a/src/internal/operators/shareReplay.ts +++ b/src/internal/operators/shareReplay.ts @@ -152,7 +152,6 @@ function shareReplayOperator({ let refCount = 0; let subscription: Subscription | undefined; let hasError = false; - let isComplete = false; return function shareReplayOperation(this: Subscriber, source: Observable) { refCount++; @@ -166,7 +165,6 @@ function shareReplayOperator({ subject!.error(err); }, complete() { - isComplete = true; subscription = undefined; subject!.complete(); }, @@ -177,7 +175,7 @@ function shareReplayOperator({ this.add(() => { refCount--; innerSub.unsubscribe(); - if (subscription && !isComplete && useRefCount && refCount === 0) { + if (subscription && useRefCount && refCount === 0) { subscription.unsubscribe(); subscription = undefined; subject = undefined;