computeAll method

FutureOr<Map<ComputeIDs<D>, V>> computeAll({
  1. bool throwError = true,
  2. FutureOr<V> onError(
    1. Object error,
    2. StackTrace stackTrace
    )?,
  3. V? onErrorValue,
})

Resolves all computations and returns a map with the same keys.

If throwError is true, the first error is propagated. Otherwise, onError or onErrorValue is used to produce a fallback value.

The result may be returned synchronously or asynchronously.

Implementation

FutureOr<Map<ComputeIDs<D>, V>> computeAll({
  bool throwError = true,
  FutureOr<V> Function(Object error, StackTrace stackTrace)? onError,
  V? onErrorValue,
}) => Map.fromEntries(
  entries.map(
    (e) => MapEntry(
      e.key,
      e.value.resolve(
        throwError: throwError,
        onError: onError,
        onErrorValue: onErrorValue,
      ),
    ),
  ),
).resolveAllValues();