We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67d08c6 commit e055f95Copy full SHA for e055f95
src/useObserver.ts
@@ -78,10 +78,11 @@ let reactionCleanupHandle: number | undefined
78
79
function scheduleCleanupOfReactionIfNotCommitted(reaction: Reaction) {
80
uncommittedReactions.push(reaction)
81
- if (!reactionCleanupHandle) {
82
- // We currently have no cleanup timer running; schedule one
83
- reactionCleanupHandle = window.setTimeout(cleanUncommittedReactions, 100)
+ if (reactionCleanupHandle) {
+ window.clearTimeout(reactionCleanupHandle)
84
}
+ // We currently have no cleanup timer running; schedule one
85
+ reactionCleanupHandle = window.setTimeout(cleanUncommittedReactions, 100)
86
87
88
function recordReactionAsCommitted(reaction: Reaction) {
0 commit comments