disposeAll static method

Future<void> disposeAll(
  1. Iterable<FDisposable> instances
)

Implementation

static Future<void> disposeAll(final Iterable<FDisposable> instances) async {
  final innerExceptions = <FException>[];
  for (final instance in instances) {
    try {
      await instance.dispose();
    } catch (e) {
      innerExceptions.add(FException.wrapIfNeeded(e));
    }
  }
  FExceptionAggregate.throwIfNeeded(innerExceptions);
}