waitFor<S extends EffectCommandState<A, E> > method
Wait for the current or next state assignable to S.
Implementation
Future<S> waitFor<S extends EffectCommandState<A, E>>({
bool Function(S state)? where,
Duration timeout = const Duration(seconds: 5),
}) async {
final state = await waitUntil(
(state) => state is S && (where?.call(state) ?? true),
timeout: timeout,
);
return state as S;
}