Skip to content

Commit 7b68805

Browse files
authored
Listener awaits with all
1 parent 568680d commit 7b68805

File tree

1 file changed

+3
-2
lines changed
  • packages/toolkit/src/listenerMiddleware

1 file changed

+3
-2
lines changed

packages/toolkit/src/listenerMiddleware/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
addAbortSignalListener,
3131
assertFunction,
3232
catchRejection,
33+
noop,
3334
} from './utils'
3435
import {
3536
listenerCancelled,
@@ -113,7 +114,7 @@ const createFork = (
113114
)
114115

115116
if (opts?.autoJoin) {
116-
parentBlockingPromises.push(result)
117+
parentBlockingPromises.push(result.catch(noop))
117118
}
118119

119120
return {
@@ -439,7 +440,7 @@ export function createListenerMiddleware<
439440
})
440441
}
441442
} finally {
442-
await Promise.allSettled(autoJoinPromises)
443+
await Promise.all(autoJoinPromises)
443444

444445
abortControllerWithReason(internalTaskController, listenerCompleted) // Notify that the task has completed
445446
entry.pending.delete(internalTaskController)

0 commit comments

Comments
 (0)