dispatchSync property

DispatchSync<St> dispatchSync

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.
  • dispatchAll which dispatches all given actions in parallel.
  • dispatchAndWait which dispatches both sync and async actions, and returns a Future.
  • dispatchAndWaitAll which dispatches all given actions, and returns a Future.

Implementation

DispatchSync<St> get dispatchSync => _store.dispatchSync;