run<R> method

Future<R> run<R>(
  1. Future<R> body()
)

Implementation

Future<R> run<R>(Future<R> Function() body) async {
  try {
    return await _zone.run(body);
  } finally {
    // @katis:
    // Delay completion until next microtask completion.
    // Needed to make sure that all mobx state changes are
    // applied after `await run()` completes, not sure why.
    await Future.microtask(_noOp);
  }
}