A Resource with a mutable value.
value
WritableSignal<T>hasValue
this is WritableResource<Exclude<T, undefined>>@returns
this is WritableResource<Exclude<T, undefined>>set
voidConvenience wrapper for value.set.
@paramvalue
T@returns
voidupdate
voidConvenience wrapper for value.update.
@paramupdater
(value: T) => T@returns
voidstatus
Signal<ResourceStatus>The current status of the Resource, which describes what the resource is currently doing and
what can be expected of its value.
isLoading
Signal<boolean>Whether this resource is loading a new value (or reloading the existing one).
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.
@returns
booleanDescription
A Resource with a mutable value.
Overwriting the value of a resource sets it to the 'local' state.
Jump to details