registerState<S> function

void registerState <S>(
  1. {@required String stateName,
  2. @required S initialState,
  3. @required MapActionToStateCallback<S> mapActionToState}
)

This method is usefull to add a state passing stateInstance on demand.

Implementation

void registerState<S>(
    {@required String stateName,
    @required S initialState,
    @required MapActionToStateCallback<S> mapActionToState}) {
  try {
    _store.registerState(
        stateName: stateName,
        initialState: initialState,
        mapActionToState: mapActionToState);
  } catch (_) {
    throw "registerState() function should not work until you exposeApiGlobally:true inside createStore() function.";
  }
}