ConstraintJS - v0.10.2
    Preparing search index...

    Interface ConstraintOptions<T>

    Options that control how a constraint computes and tracks its value.

    interface ConstraintOptions<T = any> {
        auto_add_incoming_dependencies?: boolean;
        auto_add_outgoing_dependencies?: boolean;
        cache_value?: boolean;
        check_on_nullify?: boolean;
        context?: unknown;
        equals?: EqualityCheck<T>;
        literal?: boolean;
        run_on_add_listener?: boolean;
    }

    Type Parameters

    • T = any
    Index
    auto_add_incoming_dependencies?: boolean

    Let the solver record the constraints this one reads. Default: true

    auto_add_outgoing_dependencies?: boolean

    Let the solver record when other constraints read this one. Default: true

    cache_value?: boolean

    Keep track of the current value. Default: true

    check_on_nullify?: boolean

    When invalidated, recompute right away and only invalidate dependents if the value actually changed. Useful when many constraints depend on one that rarely changes. Default: false

    context?: unknown

    If the value is a function, the this it's called with. Default: the global object

    equals?: EqualityCheck<T>

    How to tell whether a new value is different from the old one. Default: ===

    literal?: boolean

    If the value is a function, treat the function itself as the value. Default: false

    run_on_add_listener?: boolean

    Whether onChange computes the value right away (so that the next change is noticed). Default: true