An observer is a class that can be used to observe changes to an object.

Hierarchy (view full)

Constructors

Accessors

  • get suspendEvents(): boolean
  • Returns boolean

  • set suspendEvents(value): void
  • If true the observer will not emit events when values are set.

    Parameters

    • value: boolean

    Returns void

Methods

  • Adds another emitter. Any events fired by this instance will also be fired on the additional emitter.

    Parameters

    Returns void

  • Parameters

    • name: string

      Name

    • Optional arg0: any

      First argument

    • Optional arg1: any

      Second argument

    • Optional arg2: any

      Third argument

    • Optional arg3: any

      Fourth argument

    • Optional arg4: any

      Fifth argument

    • Optional arg5: any

      Sixth argument

    • Optional arg6: any

      Seventh argument

    • Optional arg7: any

      Eights argument

    Returns Events

    Self for chaining.

  • Parameters

    • path: string

      Path to the value.

    • Optional raw: boolean

      TODO.

    Returns any

    The value at the specified path.

  • Query whether the object has the specified property.

    Parameters

    • path: string

      Path to the value.

    Returns boolean

    Returns true if the value is present and false otherwise.

  • Parameters

    • Optional target: any

      TODO.

    Returns object

    The current state of the object tracked by the observer.

  • Returns the latest observer instance. This is important when dealing with undo / redo where the observer might have been deleted and/or possibly re-created.

    Returns Observer

    The latest instance of the observer.

  • Parameters

    • path: string

      Path to the value.

    • ind: number

      Index of the value.

    • Optional silent: boolean

      If true, the remove event will not be emitted.

    • Optional remote: boolean

      TODO.

    Returns boolean

    Returns true if the value was successfully removed and false otherwise.

  • Parameters

    • path: string

      Path to the property in the object.

    • value: any

      Value to set.

    • Optional silent: boolean

      If true, the change will not be recorded in history.

    • Optional remote: boolean

      TODO.

    • Optional force: boolean

      If true, the value will be set even if it is the same as the current value.

    Returns boolean

    Returns true if the value was successfully set and false otherwise.

  • Parameters

    • path: string

      Path to the value.

    • Optional silent: boolean

      If true, the change will not be recorded in history.

    • Optional remote: boolean

      TODO.

    Returns boolean

    Returns true if the value was successfully unset and false otherwise.