dispatch method

void dispatch(
  1. Action action
)

Implementation

void dispatch(Action action) {
  var found = this._extractAction(action);
  DvaModel foundModel = found[0];
  currentModel = foundModel;
  var foundEffect = found[1];
  var foundPayload = found[2];
  foundModel.dispatch(foundEffect(foundPayload));
  foundModel.state.listen((onData) {
    modelStreams
        .singleWhere((m) {
          return m.nameSpace == foundModel.nameSpace;
        })
        .streamController
        .sink
        .add(onData);
  });
}