Interface Context_Batch

if ctx is your context, then these function members are available under ctx.batch.
the purpose of these functions is to widthold any signals from firing until the batching is complete, and then all signals are fired together in one single propagation cycle.
this is useful in circumstances where you have a array or dictionary like signal which must undergo many mutations all at once. // TODO-DOC: give an example

interface Context_Batch {
    startBatching: (() => number);
    endBatching: (() => void);
    scopedBatching: (<T, ARGS>(fn, ...args) => T);
}

Properties

startBatching: (() => number)

Type declaration

    • (): number
    • Returns number

endBatching: (() => void)

Type declaration

    • (): void
    • Returns void

scopedBatching: (<T, ARGS>(fn, ...args) => T)

Type declaration

    • <T, ARGS>(fn, ...args): T
    • Type Parameters

      • T extends unknown = void
      • ARGS extends any[] = []

      Parameters

      • fn: ((...args) => T)
          • (...args): T
          • Parameters

            Returns T

      • Rest ...args: ARGS

      Returns T

Generated using TypeDoc