useAsyncValue<T> function
Turn the Future returned by future
into an AsyncValue
.
The returned future
is memoized and re-evaluated whenever keys
change.
Implementation
AsyncValue<T> useAsyncValue<T>(
Future<T> Function() future, [
List<Object?> keys = const <Object>[],
]) =>
useFuture(
useMemoized(() => AsyncValue.guard(future), keys),
initialData: AsyncValue<T>.loading(),
).data!;