load method

Future<Resource<V>> load(
  1. K key, {
  2. bool? forceReload,
  3. void doOnStore(
    1. V
    )?,
  4. ResourceFetchArguments? fetchArguments,
  5. bool allowEmptyLoading = false,
})

Same as stream, but waiting only for the first completed result.

Implementation

Future<Resource<V>> load(
  K key, {
  bool? forceReload,
  void Function(V)? doOnStore,
  ResourceFetchArguments? fetchArguments,
  bool allowEmptyLoading = false,
}) =>
    stream(
      key,
      forceReload: forceReload,
      doOnStore: doOnStore,
      fetchArguments: fetchArguments,
      allowEmptyLoading: allowEmptyLoading,
    ).where((r) => r.isNotLoading).first;