Skip to content

realmPlugin

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/packages/editor/src/RealmWithPlugins.tsx

A function that creates an editor plugin.

Signature

ts
function realmPlugin(plugin: {
  /**
   * Called when the MDXEditor component is mounted and the plugin is initialized.
   */
  init?: (realm: Realm, params?: Params) => void

  /**
   * Called after the MDXEditor component is mounted and all plugins are initialized.
   */
  postInit?: (realm: Realm, params?: Params) => void
  /**
   * Called on each re-render. Use this to update the realm with updated property values.
   */
  update?: (realm: Realm, params?: Params) => void
}): (params?: Params) => RealmPlugin

Parameters

NameType
plugin`{
/**
  • Called when the MDXEditor component is mounted and the plugin is initialized. */ init?: (realm: Realm, params?: Params) => void

/**

  • Called after the MDXEditor component is mounted and all plugins are initialized. / postInit?: (realm: Realm, params?: Params) => void /*
  • Called on each re-render. Use this to update the realm with updated property values. */ update?: (realm: Realm, params?: Params) => void }` |

Returns: (params?: Params) => RealmPlugin

Was this page helpful?

Download as PDF