kibana/docs/development/core/server/kibana-plugin-server.icontextcontainer.createhandler.md

1.1 KiB

Home > kibana-plugin-server > IContextContainer > createHandler

IContextContainer.createHandler() method

Create a new handler function pre-wired to context for the plugin.

Signature:

createHandler(pluginOpaqueId: PluginOpaqueId, handler: THandler): (...rest: HandlerParameters<THandler>) => ShallowPromise<ReturnType<THandler>>;

Parameters

Parameter Type Description
pluginOpaqueId PluginOpaqueId The plugin opaque ID for the plugin that registers this handler.
handler THandler Handler function to pass context object to.

Returns:

(...rest: HandlerParameters<THandler>) => ShallowPromise<ReturnType<THandler>>

A function that takes THandlerParameters, calls handler with a new context, and returns a Promise of the handler return value.