A Signal with a .set() method and writable .value property.

interface Writable<T> {
    asReadonly(): Signal<T>;
    peek(): T;
    set: ((val: T) => void);
    value: T;
    withSet(set: ((v: T) => unknown)): Writable<T>;
    (sink: Sink<T>, conn?: Connection, inlet?: Throttle | Inlet): "uneventful/is-stream";
    (): T;
}

Type Parameters

  • T

Hierarchy (view full)

Reading

  • Get the signal's current value, without adding the signal as a dependency

    (This is exactly equivalent to calling peek(signal), and exists here mainly for interop with other signal frameworks.)

    Returns T

  • get value(): T
  • The current value

    Returns T

  • set value(val: T): void
  • Set the current value

    Parameters

    • val: T

    Returns void

Writing

set: ((val: T) => void)

Set the current value. (Note: this is a bound method so it can be used as a callback.)

Type declaration

    • (val: T): void
    • Parameters

      • val: T

      Returns void