makeState<T> static method
Implementation
static AsyncState<T> makeState<T>({
required ValueCell<T> current,
}) {
final last = (current as ValueCell<T?>)
.onError(NoneCell())
.onError(null.cell);
try {
return AsyncStateData(current(), last());
}
on PendingAsyncValueError {
return AsyncStateLoading(last());
}
catch (e, trace) {
return AsyncStateError(e, trace, last());
}
}