waitAllActions<St> static method

Future<void> waitAllActions<St>(
  1. BuildContext context,
  2. List<ReduxAction<St>> actions
)

Returns a future that completes when ALL given actions finished dispatching.

Example:

// Dispatching two actions in PARALLEL and waiting for both to finish.
var action1 = ChangeNameAction('Bill');
var action2 = ChangeAgeAction(42);
await waitAllActions([action1, action2]);

// Compare this to dispatching the actions in SERIES:
await dispatchAndWait(action1);
await dispatchAndWait(action2);

Implementation

static Future<void> waitAllActions<St>(BuildContext context, List<ReduxAction<St>> actions) {
  if (actions.isEmpty) throw StoreException('You have to provide a non-empty list of actions.');
  return backdoorInheritedWidget<St>(context).waitAllActions(actions);
}