Skip to content

Commit 22f86e0

Browse files
committed
chore(core): improve shareLatest implementation
1 parent ffa503a commit 22f86e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/internal/share-latest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ const shareLatest = <T>(
4949
subject!.complete()
5050
},
5151
)
52+
if (subscription.closed) subscription = null
5253
emitIfEmpty()
53-
if (subscription && subscription.closed) subscription = null
5454
} else {
5555
innerSub = subject.subscribe(subscriber)
5656
if (currentValue !== EMPTY_VALUE) {

0 commit comments

Comments
 (0)