perform<T> static method

Future<T> perform<T>(
  1. FutureOr<T> action(
    1. DspReg disposers
    )
)

Implementation

static Future<T> perform<T>(
  FutureOr<T> Function(DspReg disposers) action,
) async {
  final disposers = DspImpl();

  try {
    return await action(disposers);
  } finally {
    await disposers.dispose();
  }
}