A WritableResource created through the resource function.
hasValue
this is ResourceRef<Exclude<T, undefined>>@paramthis
T extends undefined ? this : never@returns
this is ResourceRef<Exclude<T, undefined>>hasValue
boolean@returns
booleandestroy
voidManually destroy the resource, which cancels pending requests and returns it to idle state.
@returns
voidvalue
WritableSignal<T>set
voidConvenience wrapper for value.set.
@paramvalue
T@returns
voidupdate
voidConvenience wrapper for value.update.
@paramupdater
(value: T) => T@returns
voidreload
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
booleanstatus
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).
Jump to details