Documentation - v0.0.10
    Preparing search index...

    Interface WriteSignal<T>

    Describes a signal that can be written to.

    interface WriteSignal<T> {
        _writeSignal: true;
        set(newValue: T): void;
        update(cb: (oldValue: T) => T): void;
    }

    Type Parameters

    • T
    Index

    Properties

    Methods

    Properties

    _writeSignal: true

    A marker property to identify this as a signal-like object.

    Methods

    • Queues setting a new value for the signal to the next microtask. If the new value is different from the current value (based on the equality function), all registered dependents will be notified of the new value.

      Parameters

      • newValue: T

      Returns void

    • Queues updating the signal's value based on its current value to the next microtask. If the new value is different from the current value (based on the equality function), all registered dependents will be notified of the new value.

      Parameters

      • cb: (oldValue: T) => T

      Returns void