Options
All
  • Public
  • Public/Protected
  • All
Menu

A class which allows nested suspend/resume operations on an ISuspendable target

Hierarchy

Implements

Index

Constructors

constructor

  • Creates an instance of an UpdateSuspender

    Parameters

    • target: ISuspendable

      The target that we want to suspend. Multiple nested suspend/resumes are permitted

    • Default value shouldResumeTarget: boolean = true

      This flag is passed through to the target on resume

    Returns UpdateSuspender

Properties

Static Readonly suspendedInstances

suspendedInstances: Dictionary<SuspendedInstance> = new Dictionary<SuspendedInstance>()

USED INTERNALLY: A map of string Id to Suspended instances

Accessors

isSuspended

  • get isSuspended(): boolean
  • Gets whether the current instance is suspended

    Returns boolean

shouldResumeTarget

  • get shouldResumeTarget(): boolean
  • Gets whether the target should resume once updates are resumed

    Returns boolean

Methods

delete

  • delete(): void

Protected remove

  • remove(): void
  • Returns void

resume

  • resume(): void

Static getIsSuspended

  • Get whether the provided ISuspendable instance is suspended or not

    Parameters

    Returns boolean

Static using

  • using(target: ISuspendable, batchOperation: () => void): void
  • A helper function to perform multiple operations in a single batch with a single redraw at the end

    remarks

    Implements the .suspendUpdates() and .resume() pattern around a function. Equivalent to calling target.suspendUpdates(), batchOperation() then .resume()

    Parameters

    • target: ISuspendable

      The target that we want to suspend and resume around a batch operation

    • batchOperation: () => void
        • (): void
        • Returns void

    Returns void

Generated using TypeDoc