Skip to content

CommandHandlerComponent.registerCommandHandlers method

CommandHandlerComponent › registerCommandHandlers

Registers the given command handlers with Obsidian and provides each its own runtime registration context. Each handler's command is added immediately; the returned DisposableEx removes the commands registered by this call — and any menu events those handlers registered via their context's MenuEventRegistrar — when disposed. Any command still registered when the component unloads is removed automatically.

Signature:

registerCommandHandlers(commandHandlers: CommandHandler[]): DisposableEx

Parameters:

ParameterTypeDescription
commandHandlersCommandHandler[]The command handlers to register.

Returns: DisposableExA DisposableEx that unregisters the handlers (commands + menu events) passed to this call.