Skip to content

Commit

Permalink
chore: check callback before setTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Sep 25, 2020
1 parent 8f85b25 commit 8c9a4a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/internal/Subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ function handleStoppedNotification(
notification: { kind: 'N'; value: any } | { kind: 'E'; error: any } | { kind: 'C' },
subscriber: Subscriber<any>
) {
setTimeout(() => config.onStoppedNotification?.(notification, subscriber));
const { onStoppedNotification } = config;
onStoppedNotification && setTimeout(() => onStoppedNotification(notification, subscriber));
}

/**
Expand Down

0 comments on commit 8c9a4a7

Please sign in to comment.