Interface Writable<T>

Writable interface for both updating and subscribing.

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;
}

Type Parameters

  • T
Hierarchy

Methods

  • Set value and inform subscribers.

    Parameters

    • this: void
    • value: T

      to set

    Returns void

  • Update value using callback and inform subscribers.

    Parameters

    Returns void