turbodombuilder - v0.9.22
    Preparing search index...

    Type Alias SignalEntry<Type>

    Type that represents a base signal object.

    const count: SignalEntry<number> = makeSignal(0);
    const unsub = count.sub(() => console.log("count:", count.get()));
    count.set(1); // logs "count: 1"
    count.update(c => c+1); // logs "count: 2"
    unsub();
    type SignalEntry<Type = any> = {
        get(): Type;
        set(value: Type): void;
        update(updater: (previous: Type) => Type): void;
        sub(fn: SignalSubscriber): () => void;
        emit(): void;
    }

    Type Parameters

    • Type = any
    Index

    Methods

    • Retrieve the signal value.

      Returns Type

    • Set the signal value.

      Parameters

      Returns void

    • Set the value using a pure updater based on the previous value.

      Parameters

      Returns void

    • Subscribe to change notifications. Returns an unsubscribe function.

      Parameters

      • fn: SignalSubscriber

      Returns () => void

    • Force a notification cycle without changing the value (useful after in-place mutation of structural data).

      Returns void