@bodil/signal
    Preparing search index...

    Type Alias Options<A>

    type Options<A> = {
        "[unwatched]"?: () => void;
        "[watched]"?: () => void;
        equals?: (a: A, b: A) => boolean;
    }

    Type Parameters

    • A

    Properties

    "[unwatched]"?: () => void
    "[watched]"?: () => void
    equals?: (a: A, b: A) => boolean

    A function used to compare the new value of a signal with the previous value when the signal's value updates. If the function returns false, this will cause the signal's dependencies to update themselves with the new value, because the value is considered to have changed. If the function returns true, dependencies will not be updated, because no change is considered to have occurred.

    This option defaults to using ObjectConstructor.is.