Type alias ReadResult<T, E>
ReadResult<T, E>: { data: undefined; error: undefined; loading: true; } | { data: T; error: undefined; loading: false; } | { data: undefined; error: E; loading: false; } Type declaration
data: undefined
error: undefined
loading: true
Type declaration
data: T
error: undefined
loading: false
Type declaration
data: undefined
error: E
loading: false
A discriminated union of the possible results of a read operation.
You can rely on the
loading
value to determine if thedata
orerror
can be evaluated.If
error
isundefined
, thendata
value will be available.