Interface MinimalWritable<T>
interface MinimalWritable<T> {
set(this: void, value: T): void;
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
}
set(this: void, value: T): void;
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
}
Type Parameters
Methods
set
- set(this, value): void
Set value and inform subscribers.
Parameters
- this: void
- value: T
to set
Returns void
subscribe
- subscribe(this, run, invalidate?): Unsubscriber
Subscribe on value changes.
Parameters
- this: void
- run: Subscriber<T>
subscription callback
Optional
invalidate: Invalidator<T>cleanup callback
Returns Unsubscriber
The minimal requirements of the writable store contract.
A minimal writable is a Readable / subscribable, but only has a
set
method omitting theupdate
method fromWritable
.