Interface ModelStartOptions

interface ModelStartOptions {
    async?: boolean;
    copy?:
        | "input"
        | "none"
        | "output"
        | "both";
    mode?:
        | "diffDeep"
        | "diff"
        | "arrayDeep"
        | "array";
}

Properties

Properties

async?: boolean

If true, then upon input changes, defer evaluation of the function to the next tick, instead of immediately evaluating the function upon each input change.

Warning: Avoid using async: true if there's any controller code that does a model.get() on the output path or on any paths downstream of the output, since changes to an input path won't immediately result in the output being updated.

copy?:
    | "input"
    | "none"
    | "output"
    | "both"

Whether to deep-copy the input/output of the reactive function.

  • output (default)
  • input
  • both
  • none
mode?:
    | "diffDeep"
    | "diff"
    | "arrayDeep"
    | "array"

Comparison mode for the output of the reactive function, when determining whether and how to update the output path based on the function's return value.

  • 'diffDeep' (default) - Do a recursive deep-equal comparison on old and new output values, attempting to issue fine-grained ops on subpaths where possible.
  • 'diff - Do an identity comparison (===) on the output value, and do a simple set if old and new outputs are different.
  • 'arrayDeep' - Compare old and new arrays item-by-item using a deep-equal comparison for each item, issuing top-level array insert, remove,, and move ops as needed. Unlike 'diffDeep', this will not issue ops inside array items.
  • 'array' - Compare old and new arrays item-by-item using identity comparison (===) for each item, issuing top-level array insert, remove,, and move ops as needed.