A Resource is an asynchronous dependency (for example, the results of an API call) that is managed and delivered through signals.
value
Signal<T>The current value of the Resource, or throws an error if the resource is in an error state.
status
Signal<ResourceStatus>The current status of the Resource, which describes what the resource is currently doing and
what can be expected of its value.
error
Signal<Error | undefined>When in the error state, this returns the last known error from the Resource.
isLoading
Signal<boolean>Whether this resource is loading a new value (or reloading the existing one).
hasValue
this is Resource<Exclude<T, undefined>>Whether this resource has a valid current value.
This function is reactive.
@paramthis
T extends undefined ? this : never@returns
this is Resource<Exclude<T, undefined>>hasValue
boolean@returns
booleanJump to details