Skip to content

ComponentEx.ensureLoaded method

ComponentEx › ensureLoaded

Ensures the component is loaded, throwing if it is not.

Use this to guard public methods that register teardown-bearing resources (via Component.register, Component.registerEvent, Component.registerDomEvent, etc.). Registering before load is unsafe: Component.unload is a no-op while the component is not loaded, so any teardown registered beforehand would never run if the component is unloaded without first being loaded.

Signature:

ensureLoaded(): void

Returns: void