Skip to content

Commit dbd1594

Browse files
committed
Clear timers using pop
1 parent 8ac4d2e commit dbd1594

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/handleEvent.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ export function handleEvent<Context = unknown, Event = unknown>(
201201
// When transitioning, we have to reset all timers.
202202
// Since this is pass-by-reference, we have to modify the existing array!
203203
if (options.timers) {
204-
options.timers.length = 0
204+
while (options.timers.length > 0) {
205+
options.timers.pop()
206+
}
205207
}
206208

207209
return handleEvent(

0 commit comments

Comments
 (0)