Interface IOWritable<W, R>

Extends Writable to allow type differentiation between writing and reading data. This is useful when converting or transforming input data to a different or more specific output.

interface IOWritable<W, R> {
    set(this: void, value: W): void;
    subscribe(
        this: void,
        run: Subscriber<R>,
        invalidate?: Invalidator<R>,
    ): Unsubscriber;
    update(this: void, updater: Updater<W>): void;
}

Type Parameters

  • W

    Writable / input type.

  • R

    Readable / output type.

Hierarchy

Methods

  • Set value and inform subscribers.

    Parameters

    • this: void
    • value: W

      to set

    Returns void

  • Update value using callback and inform subscribers.

    Parameters

    Returns void