Interface DerivedBindingOptions<GetT>

interface DerivedBindingOptions<GetT> {
    areInputValuesEqual?: ((a, b) => boolean);
    areOutputValuesEqual?: ((a, b) => boolean);
    deps?: DependencyList;
    detectInputChanges?: boolean;
    detectOutputChanges?: boolean;
    id: string;
    limitMSec?: number;
    limitMode?: LimitMode;
    limitType?: LimitType;
    makeComparableInputValue?: (() => any);
    priority?: number;
    queue?: RunQueue;
}

Type Parameters

  • GetT

Hierarchy (view full)

Properties

areInputValuesEqual?: ((a, b) => boolean)

If specified, overrides the function used to compare input values

Type declaration

    • (a, b): boolean
    • If specified, overrides the function used to compare input values

      Parameters

      • a: any
      • b: any

      Returns boolean

      Default Value

      _.isEqual, which can be globally overridden using setAreEqual

Default Value

_.isEqual, which can be globally overridden using setAreEqual

areOutputValuesEqual?: ((a, b) => boolean)

If specified, overrides the function used to compare output values

Type declaration

    • (a, b): boolean
    • If specified, overrides the function used to compare output values

      Parameters

      Returns boolean

      Default Value

      _.isEqual, which can be globally overridden using setAreEqual

Default Value

_.isEqual, which can be globally overridden using setAreEqual

deps?: DependencyList

On a rerender, deps changes are treated like bindings changes. That is, if they change between renders, the input change detection logic is run (using the areInputValuesEqual, detectInputChanges, and makeComparableInputValue values) using the limiter (see LimiterOptions).

detectInputChanges?: boolean
  • If trueareInputValuesEqual is used to compare the old and new results of makeComparableInputValue when any of the input bindings or deps are changed. If the values are equal, the transformer won't be run. If they're unequal, the transformer will be run.
  • If false – old and new values aren't compared, the transformer will always be run.

Default Value

true

detectOutputChanges?: boolean
  • If trueareOutputValuesEqual is used to compare the old and new results of the transformer function, each time it's run. If the values are equal, the derived binding's value won't be changed. If they're unequal, the binding value will be changed and listeners will be notified.
  • If false – old and new results of the transformer function aren't compared. The derived binding's value will always be changed each time the transformer function is run.

Default Value

true

id: string

A technical, but human-readable ID, which isn't guaranteed to be unique

limitMSec?: number

The duration to debounce/throttle for

Default Value

0

limitMode?: LimitMode

The limiter mode

Default Value

'trailing'

limitType?: LimitType

The type of limiter

Default Value

'debounce'

makeComparableInputValue?: (() => any)

By default, when detectInputChanges is true, the input is compared using all specified bindings. This behavior can be overridden by providing this function to generate a value that can be compared instead. The generated value will be remembered until the next comparison is needed. Comparisons are performed using areInputValuesEqual

Type declaration

    • (): any
    • By default, when detectInputChanges is true, the input is compared using all specified bindings. This behavior can be overridden by providing this function to generate a value that can be compared instead. The generated value will be remembered until the next comparison is needed. Comparisons are performed using areInputValuesEqual

      Returns any

      Default Value

      A function that returns the values of all input bindings and the deps
      

Default Value

A function that returns the values of all input bindings and the deps
priority?: number

The priority

Default Value

DEFAULT_PRIORITY (0)

queue?: RunQueue

The queue

Default Value

result of useDefaultQueue()

Generated using TypeDoc