Use to register to various Needle Engine context events and to get access to all current instances
e.g. when being created in the DOM

Example

import { NeedleEngine } from "./engine/engine_context_registry.js";
NeedleEngine.addContextCreatedCallback((evt) => {
console.log("Context created", evt.context);
});

Constructors

Properties

Registered: Context[] = []

All currently registered Needle Engine contexts. Do not modify

Accessors

  • get All(): Context[]
  • Returns the array of all registered Needle Engine contexts. Do not modify

    Returns Context[]

  • get Current(): Context
  • The currently active (rendering) Needle Engine context

    Returns Context

Methods

  • Register a callback to be called when a context is created

    Parameters

    • callback: ContextCallback

    Returns void

  • Register a callback to be called when a context is registered

    Parameters

    • callback: ContextCallback

    Returns void

  • Register a callback to be called when the given event occurs

    Parameters

    Returns void

  • Unregister a callback

    Parameters

    Returns void

Generated using TypeDoc