This object encapsulates all state parameters for an instance of BG.charts.Object: loading started/stopped/destroyed errors Changes to this object are automatically emitted by it's parent as a stateChanged event

Hierarchy (View Summary)

Constructors

Methods

  • store an error on this state object multiple errors for different domains can be stored at the same time

    Parameters

    Returns void

  • checks if the associated object can recover from a previously encountered error Note: will return false if there is no error stored in this state object!

    Returns boolean

  • clear all errors stored in this state object if the optional domain parameter is supplied, only errors beloging to that domain are cleared

    Parameters

    • Optionaldomain: string

      an optional error domain

    Returns void

  • stop a previously started loading task that was started with BG.charts.Object.State::startLoading

    When called a label for which no task is currently pending an exception will be thrown

    Parameters

    • Optionallabel: string
    • Optionalerror: Error

      an optional error that was encountered by this loading task

    Returns void

  • retrieves the error with the highest priority if one is available returns null if no errors are stored in this state object

    if the optional domain parameter is supplied, only errors of that domain are considered

    Parameters

    • Optionaldomain: string

    Returns null | Error

  • returns all errors currently stored in this state object if there are no errors, returns an empty array

    Returns Error[]

  • checks if the associated object was destroyed

    Returns boolean

  • checks if the associated object is currently loading

    if an optional label is specified will only return true if a task with that label is currently loading e.g. startLoading was called with that label, but stopLoading was not yet called

    Parameters

    • Optionallabel: string

      optional name of the task to be checked

    Returns boolean

  • checks if the associated object was started and is currently active

    Returns boolean

  • Type Parameters

    • Type extends "changed"

    Parameters

    Returns this

    removes all listeners, or those of the specified event.

  • Parameters

    • maxListeners: number

    Returns this

    by default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that limit to be increased. Set to zero for unlimited.

  • start a loading task BG.charts.Object.State::endLoading needs to be called when the task is finished Multiple tasks can be running at the same time

    For every label only one task can be active at a time; trying to start another one with the same label before stopping the pending one will throw an exception

    Parameters

    • Optionallabel: string

    Returns void

  • Parameters

    • cb: Function

    Returns void

    set custom error handler for event listeners

  • Parameters

    • maxListeners: number

    Returns void

    set default amount for limit warning