valueOrNull method
T?
valueOrNull()
Returns the best available usable value, or null if none.
Priority:
- Ready / Updating / Dirty -> current value
- Loading(prev) -> prev
- Failure(prev) -> prev
- Uninitialized / Empty -> null
Implementation
T? valueOrNull() {
return either<T?>(
(v) => v,
(_) => null,
);
}