Interface Writable<T>
interface Writable<T> {
set(this: void, value: T): void;
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
update(this: void, updater: Updater<T>): void;
}
set(this: void, value: T): void;
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
update(this: void, updater: Updater<T>): void;
}
Type Parameters
Hierarchy
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
Writable interface for both updating and subscribing.