isWaiting static method

bool isWaiting(
  1. BuildContext context,
  2. Object actionOrTypeOrList, {
  3. bool notify = true,
})

You can use isWaiting and pass it actionOrActionTypeOrList to check if:

  • A specific async ACTION is currently being processed.
  • An async action of a specific TYPE is currently being processed.
  • If any of a few given async actions or action types is currently being processed.

If you wait for an action TYPE, then it returns false when:

  • The ASYNC action of the type is NOT currently being processed.
  • If the type is not really a type that extends ReduxAction.
  • The action of the type is a SYNC action (since those finish immediately).

If you wait for an ACTION, then it returns false when:

  • The ASYNC action is NOT currently being processed.
  • If the action is a SYNC action (since those finish immediately).

Trying to wait for any other type of object will return null and throw a StoreException after the async gap.

Widgets that use this method WILL rebuild whenever the state changes (unless you pass the notify parameter as false).

Implementation

static bool isWaiting(
  BuildContext context,
  Object actionOrTypeOrList, {
  bool notify = true,
}) =>
    (notify ? _getStoreWithDependency_Untyped : _getStoreNoDependency_Untyped)(context)
        .isWaiting(actionOrTypeOrList);