waitCondition method

Future<ReduxAction<St>?> waitCondition(
  1. bool condition(
    1. St
    ), {
  2. int? timeoutMillis,
})

Returns a future which will complete when the given state condition is true. If the condition is already true when the method is called, the future completes immediately.

You may also provide a timeoutMillis, which by default is 10 minutes. To disable the timeout, make it -1. If you want, you can modify Store.defaultTimeoutMillis to change the default timeout.

var action = await store.waitCondition((state) => state.name == "Bill");
expect(action, isA<ChangeNameAction>());

Implementation

Future<ReduxAction<St>?> waitCondition(
  bool Function(St) condition, {
  int? timeoutMillis,
}) =>
    _store.waitCondition(condition, timeoutMillis: timeoutMillis);