importState method

void importState (
  1. Map<String, dynamic> state
)

state object should be a Map<String, dynamic> state

Example

var state={'counter':CounterModel(count:5, isLoading:false)};
store.importState(state);

Implementation

void importState(Map<String, dynamic> state) {
  _states.forEach((s) {
    if (!state.containsKey(s.name)) {
      state[s.name] = s.initialState;
    }
  });
  _action = Action(type: '@importState');
  _store.add(state);
}