From 0f45126a6eef237ebb86a97b8a73842844be1807 Mon Sep 17 00:00:00 2001 From: Brandon Keepers Date: Tue, 19 Mar 2024 23:07:40 -0400 Subject: [PATCH] Add createState export --- src/index.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 00f355c..6562f28 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,12 +4,16 @@ import extensions from "./extensions" export { extensions } +export function createState (state: EditorStateConfig = {}) { + return EditorState.create({ + extensions, + ...state, + }) +} + export function createEditor (element: HTMLElement, state: EditorStateConfig = {}) { return new EditorView({ parent: element, - state: EditorState.create({ - extensions, - ...state, - }), + state: createState(state), }) }