SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface ModelListenerOptions

    Options for ModelListenerOptions hook.

    This is extends IListener.Options but removes 'once' since hooks are evaluated on render and adds a ignoreModelChange option.

    interface ModelListenerOptions {
        debugText?: string;
        ignoreModelChange?: boolean;
        transactional?: boolean;
    }

    Hierarchy

    • Omit<IListener.Options, "once">
      • ModelListenerOptions
    Index
    debugText?: string

    Optional log string to identify the listener in console logs.

    Will add to console for testing.

    ignoreModelChange?: boolean

    If true, fires all listeners once immediately when the component mounts or when the source changes, allowing initialization based on current model state.

    false

    transactional?: boolean

    Whether the listener takes part in the operation that notifies it.

    true when the listener is added during an operation - a listener added as a consequence of one is part of it - and false otherwise.

    A transactional listener:

    • is told inline, inside the operation, so anything it writes joins that same commit, and is told during an undo or a redo for the same reason;
    • hears nothing announced outside an operation;
    • is part of the document: the operation that added it removes it on undo and puts it back on redo.

    A non-transactional listener:

    • is told once per operation, after it has landed, however many times the operation notified, and not at all if the operation is rolled back;
    • is told at once when there is no operation, and at once during an undo or a redo;
    • survives an undo, since it is not part of the document.