Your errored value
RemoteData Failed object
Constructs a new Loading
variant
RemoteData Loading object
Constructs a new NotAsked
variant
RemoteData NotAsked object
Constructs a new Success<T>
variant
Your remote data, typically some parsed JSON
RemoteData Failed object
Returns true if the variant is of type Failure
Wether or not the RemoteData is in a Failed state.
Returns true if the variant is of type Loading
Wether or not the RemoteData is in a Loading state.
Returns true if the variant is of type NotAsked
Wether or not the RemoteData is in a NotAsked state.
Returns true if the variant is of type Success
Wether or not the RemoteData is in a successful state.
Transforms the value within a Success variant.
A function that is passed the unwrapped success value and returns a new
Returns RemoteData with a modified Success
value.
Transforms the value within a Success or Failed variant.
A function that takes a Success
value
A function maps over the Failed
value
RemoteData with the adjusted values
Transforms the value within a Failed variant.
A function that maps over the Failed
value
Returns RemoteData with a modified Failed
value.
"Pattern matches" over a RemoteData type and run the function of the matching variant. All functions much return the same type. This may change if pattern matching gets adopted into the language.
A way of extracting the value. All functions much return the same type.
Take a default value, a function and a RemoteData
.
Return the default value if the RemoteData
is something other than Success<T>
.
If the RemoteData
is Success<T>
, apply the function on T
and return the U
.
Extracts the value our of the Success variant or returns the default.
Return the Success
value, or the default.
Generated using TypeDoc
Constructs a new
Failed<E>
variant