Skip to content

Commit

Permalink
fix: use same event dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyg authored and SomaticIT committed Feb 27, 2024
1 parent b400ecf commit 409cae6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/CodeMirror.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
export let nodebounce = false;
const is_browser = typeof window !== "undefined";
const dispatch = createEventDispatcher<{ change: string }>();
const dispatchReady = createEventDispatcher<{ ready: string }>();
const dispatch = createEventDispatcher<{ change: string, ready: EditorView }>();
let element: HTMLDivElement;
let view: EditorView;
Expand All @@ -59,7 +58,7 @@
onMount(() => {
view = create_editor_view();
dispatchReady(view);
dispatch('ready', view);
});
onDestroy(() => view?.destroy());
Expand Down

0 comments on commit 409cae6

Please sign in to comment.