Interface WritableSignal<T, U>

Represents a store that implements both ReadableSignal and Writable. This is the type of objects returned by writable.

interface WritableSignal<T, U> {
    [observable](): Readable<T>;
    set(value): void;
    subscribe(subscriber): UnsubscribeFunction & UnsubscribeObject;
    update(updater): void;
    (): T;
}

Type Parameters

  • T

  • U = T

Hierarchy (view full)

  • Returns the value of the store. This is a shortcut for calling get with the store.

    Returns T

Methods

  • Replaces store's state with the provided value.

    Parameters

    • value: U

      value to be used as the new state of a store.

    Returns void

  • Updates store's state by using an Updater function.

    Parameters

    • updater: Updater<T, U>

      a function that takes the current state as an argument and returns the new state.

    Returns void

Generated using TypeDoc