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
subscribe
- subscribe(
this: void,
run: Subscriber<T>,
invalidate?: Invalidator<T>,
): 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.