asyncGroup
The asyncGroup() function aggregates synchronous or asynchronous Right values from an object, array, or tuple into a Success. It awaits entries in order and returns the first Left encountered.
Interactive example
The const generic parameter automatically infers an array literal as a tuple, without an as const assertion.
Syntax
typescript
await E.asyncGroup(group)Parameters
group: Object, array, or tuple containingEither,Promise, orFuturevalues, or functions returning any of these types.
Return value
- A
Promiseof aSuccesscontaining an object, array, or tuple of unwrapped values when every entry produces aRight. - Otherwise, a
Promiseof the firstLeftin declaration order. Functions placed after thatLeftare not called.
See also
group- Synchronous versionrightAsyncPipe- Async pipeline onRightfuture- Compatible async wrapper
