A signal that holds a reactive value.

When the value changes, all users of that value (computed signals, effects, watchers) are notified automatically.

interface ReadonlyReactive<T> {
    value: T;
    peek(): T;
    toJSON(): T;
    toString(): string;
}

Type Parameters

  • T

Hierarchy (View Summary)

Methods

Properties

Methods

  • Accesses the current value without being considered a user of this value.

    Use this method if you do not wish to be notified about changes.

    Returns T

  • Same as .value.

    For compatibility with builtin JS constructs.

    Returns T

  • Formats .value as a string.

    For compatibility with builtin JS constructs.

    Returns string

Properties

value: T

Accesses the current value stored in this signal.

This access is tracked: users (computed signals, effects, etc.) will be registered as a user of this value and will be notified when it changes.