context<T> method

void context<T>(
  1. String key,
  2. dynamic fn(
    1. T
    )
)

Implementation

void context<T>(String key, Function(T) fn) {
  final command =
      _commandMapper.entries.firstWhere((element) => element.key == key);
  fn(command.value());
}