callAll method

Resolvable<Map<Object, Result<Option<T>>>> callAll(
  1. TParam param, {
  2. Set? include,
  3. Set exclude = const {},
  4. bool eagerError = true,
  5. void onError(
    1. Err<Object> err
    )?,
})

Implementation

Resolvable<Map<Object, Result<Option<T>>>> callAll(
  TParam param, {
  Set<dynamic>? include,
  Set<dynamic> exclude = const {},
  bool eagerError = true,
  void Function(Err err)? onError,
}) {
  final results = <Object, Result<Option<T>>>{};
  for (final e in _callbacks.entries) {
    if (include == null || include.contains(e)) {
      if (exclude.isEmpty || !exclude.contains(e)) {
        final callbackKey = e.key;
        call(
          callbackKey,
          param,
          eagerError: eagerError,
          onError: onError,
        ).end();
        _seq.addSafe((e) {
          results[callbackKey] = e;
          return syncNone();
        }).end();
      }
    }
  }
  return _seq.last.map((e) => results);
}