File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ export function createQuery(instanceOptions?: Configuration): Query {
167167 // For the refetching event, we want to immediately return if there's
168168 // a pending resolver.
169169 if ( event === 'refetching' && value !== undefined ) {
170- emit ( key , event , value . item )
170+ queueMicrotask ( ( ) => emit ( key , event , value . item ) )
171171 }
172172
173173 return function ( ) {
@@ -426,7 +426,7 @@ export function createQuery(instanceOptions?: Configuration): Query {
426426
427427 // Adds the resolver to the cache.
428428 resolversCache . set ( key , { item : result , controller } )
429- emit ( key , 'refetching' , result )
429+ queueMicrotask ( ( ) => emit ( key , 'refetching' , result ) )
430430
431431 // The promise executor runs synchronously,
432432 // so trigger is guaranteed to be defined here.
You can’t perform that action at this time.
0 commit comments