ComponentEx.registerDisposable method
ComponentEx › registerDisposable
Registers aDisposable so it is disposed when this component unloads, and returns it unchanged.The recurring "tie a disposable to the component's lifecycle, then keep using it" idiom: the disposable is disposed on
Component.unload (or earlier, if the caller disposes it directly — dispose is expected to be idempotent). Guard with ensureLoaded at the call site when registering before load would be unsafe.Signature:
registerDisposable(disposable: TDisposable): TDisposableParameters:
| Parameter | Type | Description |
|---|---|---|
| disposable | TDisposable | The disposable to register. |
Returns: TDisposable — The same disposable, for chaining.