WritableResource
A Resource with a mutable value.
hasValue
this is WritableResource<Exclude<T, undefined>>T extends undefined ? this : neverthis is WritableResource<Exclude<T, undefined>>hasValue
booleanbooleanset
voidConvenience wrapper for value.set.
Tvoidupdate
voidConvenience wrapper for value.update.
(value: T) => TvoidasReadonly
Resource<T>Resource<T>reload
booleanInstructs the resource to re-load any asynchronous dependency it may have.
Note that the resource will not enter its reloading state until the actual backend request is made.
booleantrue if a reload was initiated, false if a reload was unnecessary or unsupported
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).
snapshot
Signal<ResourceSnapshot<T>>The current state of this resource, represented as a ResourceSnapshot.
Description
A Resource with a mutable value.
Overwriting the value of a resource sets it to the 'local' state.