MCPcopy
hub / github.com/udecode/plate / getPlugin

Function getPlugin

packages/core/src/react/plugin/getPlugin.ts:8–16  ·  view source on GitHub ↗
(
  editor: PlateEditor,
  plugin: WithRequiredKey<C>
)

Source from the content-addressed store, hash-verified

6
7/** Get editor plugin by key or plugin object. */
8export function getPlugin<C extends AnyPluginConfig = PluginConfig>(
9 editor: PlateEditor,
10 plugin: WithRequiredKey<C>
11): C extends { node: any } ? C : PlatePlugin<C> {
12 return (
13 (editor.plugins[plugin.key] as any) ??
14 createPlatePlugin({ key: plugin.key })
15 );
16}

Callers 4

EditorRefEffectFunction · 0.90
pipeOnChangeFunction · 0.90
withSlate.spec.tsFile · 0.90

Calls 1

createPlatePluginFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…