Skip to content

ComponentEx.registerAsyncDisposable method

ComponentEx › registerAsyncDisposable

Registers an AsyncDisposable so its disposal starts when this component unloads, and returns it unchanged.

Obsidian's unload is synchronous, so nothing awaits the disposal: it runs detached, and a failure is reported, never rethrown. See the free function registerAsyncDisposable, which this delegates to.

Signature:

registerAsyncDisposable(asyncDisposable: TAsyncDisposable): TAsyncDisposable

Parameters:

ParameterTypeDescription
asyncDisposableTAsyncDisposableThe async disposable to register.

Returns: TAsyncDisposable — The same async disposable, for chaining.