Skip to content

CorePluginToggleComponentConstructorParams

Parameters for the CorePluginToggleComponent constructor.

Import:

import type { CorePluginToggleComponentConstructorParams } from 'obsidian-dev-utils/obsidian/components/core-plugin-toggle-component';

Signature:

export interface CorePluginToggleComponentConstructorParams

Properties

PropertyTypeDescription
appAppThe Obsidian app instance.
corePluginIdInternalPluginNameTypeThe id of the core plugin to watch, e.g. InternalPluginName.Canvas.
onDisable?() => Promisable<void>Runs each time the core plugin goes from enabled to disabled.
onEnable?() => Promisable<void>Runs each time the core plugin goes from disabled to enabled, and once on load when the core plugin is already enabled then.
shouldCallOnDisableOnUnload?booleanWhether onDisable also runs when this component unloads while the core plugin is enabled, so every onEnable is balanced by one onDisable. Defaults to false: the core plugin did not change, so a consumer that republishes transitions must not see one.