Function: instance()
instance<
F>(ctx,factory):InstanceType<ReturnType<F>["plugin"]> |undefined
Look up a sibling plugin instance from the AppKit plugin context, keyed off the factory’s registered name and typed via its plugin class.
Returns undefined when the context is missing or the plugin is not
registered. For required siblings prefer require.
Type Parameters
Section titled “Type Parameters”F extends PluginDataFactory
Parameters
Section titled “Parameters”PluginContextLike | undefined
factory
Section titled “factory”F
Returns
Section titled “Returns”InstanceType<ReturnType<F>["plugin"]> | undefined
Example
Section titled “Example”import { lakebase } from "@databricks/appkit";import { plugin } from "@dbx-tools/appkit";
const lake = plugin.instance(this.context, lakebase);// ^^ inferred as LakebasePlugin | undefinedlake?.exports().pool;