File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -254,6 +254,8 @@ export function handleEvent<Context = unknown, Event = unknown>(
254254 eventHandlers = [ eventHandlers ] . filter ( Boolean )
255255 }
256256
257+ let timerResult = undefined
258+
257259 if ( hasTimerState ) {
258260 const timerState = csObject . $timer
259261 const timerEventHandlers : EHArray = [ ]
@@ -268,15 +270,19 @@ export function handleEvent<Context = unknown, Event = unknown>(
268270
269271 // Timers are a special snowflake, if they cause a state transition we have to continue processing normal events.
270272 // Since the handlers don't know what they are processing and to prevent constantly checking for timers, we just run them separately.
271- doEventHandlers ( timerEventHandlers )
273+ timerResult = doEventHandlers ( timerEventHandlers )
272274 }
273275
274276 const result = doEventHandlers ( eventHandlers )
275277
278+ if ( timerResult ) {
279+ return timerResult
280+ }
281+
276282 if ( result ) {
277283 return result
278284 }
279-
285+
280286 return {
281287 state : currentState ,
282288 context : newContext ,
You can’t perform that action at this time.
0 commit comments