isRecordsLoading method

  1. @visibleForTesting
  2. @protected
bool isRecordsLoading(
  1. LoadingKey loadingKey, {
  2. Query? query,
})
inherited

Tells whether the loading of records is identified by the loadingKey and the query is currently being executed.

Implementation

@visibleForTesting
@protected
bool isRecordsLoading(LoadingKey loadingKey, {Query? query}) {
  final loadMeta = _loadingDescribers[loadingKey];

  if (loadMeta == null) {
    return false;
  }

  if (query == null) {
    return !loadMeta.completer.isCompleted;
  } else {
    return !loadMeta.completer.isCompleted && query == loadMeta.query;
  }
}