run<T> static method

T run<T>(
  1. ComponentRuntime runtime,
  2. T callback()
)

Implementation

static T run<T>(ComponentRuntime runtime, T Function() callback) {
  final prev = _current;
  _current = runtime;
  try {
    return callback();
  } finally {
    _current = prev;
  }
}