dispatchSync method

ActionStatus dispatchSync(
  1. ReduxAction<St> action, {
  2. bool notify = true,
})

Runs the action, applying its reducer, and possibly changing the store state. Note: dispatchSync is of type DispatchSync.

Implementation

ActionStatus dispatchSync(ReduxAction<St> action, {bool notify = true}) {
  if (!_ifActionIsSync(action)) {
    throw StoreException(
        "Can't dispatchSync(${action.runtimeType}) because ${action.runtimeType} is async.");
  }

  return _dispatch(action, notify: notify) as ActionStatus;
}