T apply( )

apply command history reducer

Source

T apply() {
  final newState = history.fold(initialStateProvider().initial() as T,
      (T newState, Command<T> c) => c.exec(newState));
  _modelEmitter.add(newState);
  return newState;
}