Skip to content

registerPluginAsyncCleanup

Registers an async cleanup that starts when the component unloads and that the next instance of the plugin awaits.

The cleanup runs exactly once, on the component’s unload. Register it on the component whose lifetime matches the resource: a PluginBase subclass calls registerAsyncCleanup instead, which scopes it to the feature surface.

Import:

import { registerPluginAsyncCleanup } from '@mnaoumov/obsidian-lib/plugin/plugin-async-cleanup';

Signature:

function registerPluginAsyncCleanup(params: RegisterPluginAsyncCleanupParams): void

Parameters:

Parameter Type Description
params RegisterPluginAsyncCleanupParams The parameters.

Returns: void


Links to this page: