Skip to content

asyncGroup

The asyncGroup() function runs synchronous or asynchronous Either values in parallel (promises, Future) and returns the first Left encountered. If all are Right, it aggregates their values into a typed object.

Interactive example

Parameters

  • group: Object where each property is an Either/Promise/Future or a function returning any of them.

Return value

  • Right with an object gathering all values when they are all Right.
  • Otherwise the first Left that fails in the order of the group's declaration (including synchronous and asynchronous).

See also

Released under the MIT license.