A Resource
with a mutable value.
API
Description
interface WritableResource<T> extends Resource<T> {}
value
WritableSignal<T | undefined>
hasValue
boolean
@returns
boolean
set
void
Convenience wrapper for value.set
.
@paramvalue
T | undefined
@returns
void
update
void
Convenience wrapper for value.update
.
@paramupdater
(value: T | undefined) => T | undefined
@returns
void
status
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
boolean
Instructs 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
boolean
Jump to details