async<T> static method
Creates an asynchronous computed value.
compute: The async function to calculate the value.showWaiting: Iftrue, the status transitions to LxWaiting during recomputations. Defaults tofalse(stale-while-revalidate).initial: Optional initial value.staticDeps: Iftrue, the dependency graph is built only once.
Implementation
static LxAsyncComputed<T> async<T>(
Future<T> Function() compute, {
bool Function(T previous, T current)? equals,
bool showWaiting = false,
bool staticDeps = false,
T? initial,
String? name,
}) {
return LxAsyncComputed<T>(
compute,
equals: equals,
showWaiting: showWaiting,
staticDeps: staticDeps,
initial: initial,
name: name,
);
}