An union defining the possible states of a Future.
This API is still experimental, so it may change or be removed in future versions. You should not rely on it for production applications.
An union defining the possible states of a Future.
A textual representation of the state.
A textual representation of the state.
Allows a function to provide functionality to variants in an union.
The variants in the ExecutionState
True if the value is any execution state instance.
The state of a future that has been cancelled.
The state of a future that's still not resolved.
The state of a future that has been resolved with a failure.
The state of a future that has been successfully resolved with a value.
union('folktale:ExecutionState', {
/*~
*/
Pending() {
return {};
},
/*~
*/
Cancelled() {
return {};
},
/*~
*/
Resolved(value) {
return { value };
},
/*~
*/
Rejected(reason) {
return { reason };
}
}).derive(equality, debugRepresentation)