Export collab plugin key #2

Closed
dylanonelson wants to merge 1 commit from export-plugin-key into master
dylanonelson commented 2018-05-24 22:25:17 +02:00 (Migrated from github.com)

This pr exports the collab plugin key from the collab module.

Having direct access to the plugin key is useful in several scenarios:

  • You want to see whether the collab plugin is already present in the editor
  • You want to access a piece of plugin state aside from version
  • You want to debug the state of a plugin that’s already been initialized

In my project we fall under the first bullet above. The collab plugin gets initialized after the initial call to EditorState.create and we are trying to derive another piece of state based on whether it is present or not.

This pr exports the collab plugin key from the collab module. Having direct access to the plugin key is useful in several scenarios: - You want to see whether the collab plugin is already present in the editor - You want to access a piece of plugin state aside from version - You want to debug the state of a plugin that’s already been initialized In my project we fall under the first bullet above. The collab plugin gets initialized after the initial call to `EditorState.create` and we are trying to derive another piece of state based on whether it is present or not.
marijnh commented 2018-05-25 09:49:26 +02:00 (Migrated from github.com)

You want to see whether the collab plugin is already present in the editor

You can do collab().getState(editorState) to do this. I'd prefer not to export internals, when it can be avoided, so I'm not merging this change.

> You want to see whether the collab plugin is already present in the editor You can do `collab().getState(editorState)` to do this. I'd prefer not to export internals, when it can be avoided, so I'm not merging this change.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-collab!2
No description provided.