@kayahr/signal
    Preparing search index...

    Interface ToSignalOptions<T, Init>

    Options for converting an observable to a signal.

    interface ToSignalOptions<T, Init = never> {
        equals?: false | ((previous: T | Init, next: T | Init) => boolean);
        initialValue?: Init;
        requireSync?: boolean;
    }

    Type Parameters

    • T
    • Init = never
    Index

    Properties

    equals?: false | ((previous: T | Init, next: T | Init) => boolean)

    Compares the previous and next signal value.

    Returning true suppresses the update and keeps dependent computations clean. Set this to false to force an update for every emission.

    The previous signal value.

    The next signal value.

    True when both values should be treated as equal.

    initialValue?: Init

    The initial signal value used before the observable emits for the first time.

    requireSync?: boolean

    Forces the observable to emit a value synchronously during subscription.