dispatchSync method
Dispatches the action, applying its reducer, and possibly changing the store state. However, if the action is ASYNC, it will throw a StoreException.
If you pass the notify
parameter as false
, widgets will not necessarily rebuild because
of this action, even if it changes the state.
Method dispatchSync is of type DispatchSync. It returns ActionStatus
,
which means you can also get the final status of the action:
var status = store.dispatchSync(MyAction());
See also:
- dispatch which dispatches both sync and async actions.
- dispatchAndWait which dispatches both sync and async actions, and returns a Future.
Implementation
ActionStatus dispatchSync(ReduxAction action, {bool notify = true}) =>
StoreProvider.dispatchSync(this, action, notify: notify);