vendor: update cordis / loader
This commit is contained in:
Vendored
+3
-3
@@ -106,9 +106,9 @@ export class EventsService {
|
||||
|
||||
/** Run listeners concurrently and wait for all of them. */
|
||||
async parallel(...args: any[]) {
|
||||
// FIXME(cordis upstream): A synchronous listener throw aborts callback
|
||||
// enumeration here and starves later parallel listeners. Fix upstream.
|
||||
await Promise.all(this.dispatch('emit', args).map(cb => cb(...args)))
|
||||
const results = await Promise.allSettled(this.dispatch('emit', args).map(async cb => cb(...args)))
|
||||
const errors = results.filter((result): result is PromiseRejectedResult => result.status === 'rejected')
|
||||
if (errors.length) throw new AggregateError(errors.map(error => error.reason))
|
||||
}
|
||||
|
||||
/** Run listeners synchronously without waiting for returned promises. */
|
||||
|
||||
Reference in New Issue
Block a user