getCurrentState<S> method

S getCurrentState <S>()

Implementation

S getCurrentState<S>() {
  final type = _typeOf<S>();
  if (!_stateMap.containsKey(type)) {
    throw ArgumentError('No such state $type');
  }

  final stream = _stateMap[type] as BehaviorSubject<S>;

  return stream.value;
}