dispatchAndWaitAll property

Future<List<ReduxAction<St>>> Function(List<ReduxAction<St>> actions, {bool notify}) dispatchAndWaitAll

Dispatches all given actions in parallel, applying their reducers, and possibly changing the store state. The actions may be sync or async. It returns a Future that resolves when ALL actions finish.

var actions = await store.dispatchAndWaitAll([BuyAction('IBM'), SellAction('TSLA')]);

Note this is exactly the same as doing:

var action1 = BuyAction('IBM');
var action2 = SellAction('TSLA');
dispatch(action1);
dispatch(action2);
await store.waitAllActions([action1, action2], completeImmediately = true);
var actions = [action1, action2];

If you pass the notify parameter as false, widgets will not necessarily rebuild because of these actions, even if they change the state.

Note: While the state change from the action's reducers will have been applied when the Future resolves, other independent processes that the action may have started may still be in progress.

See also:

  • dispatch which dispatches both sync and async actions.
  • dispatchAndWait which dispatches both sync and async actions, and returns a Future.
  • dispatchSync which dispatches sync actions, and throws if the action is async.
  • dispatchAll which dispatches all given actions in parallel.

Implementation

Future<List<ReduxAction<St>>> Function(List<ReduxAction<St>> actions, {bool notify})
    get dispatchAndWaitAll => _store.dispatchAndWaitAll;