Function addAttributeChangeCallback

  • Register a callback when an HTMLElement attribute changes. This is used, for example, by the Skybox component to watch for changes to the environment-* and skybox-* attributes. Duplicate registrations of the same (element, name, callback) triple are silently skipped — the callback is only added once and the returned unsubscribe function still removes it correctly.

    Parameters

    • domElement: HTMLElement
    • name: string
    • callback: AttributeChangeCallback

    Returns () => void

    A function that can be used to unregister the callback