We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff22b5f commit b400ecfCopy full SHA for b400ecf
src/lib/CodeMirror.svelte
@@ -36,6 +36,7 @@
36
37
const is_browser = typeof window !== "undefined";
38
const dispatch = createEventDispatcher<{ change: string }>();
39
+ const dispatchReady = createEventDispatcher<{ ready: string }>();
40
41
let element: HTMLDivElement;
42
let view: EditorView;
@@ -56,7 +57,10 @@
56
57
58
$: on_change = nodebounce ? handle_change : debounce(handle_change, 300);
59
- onMount(() => (view = create_editor_view()));
60
+ onMount(() => {
61
+ view = create_editor_view();
62
+ dispatchReady(view);
63
+ });
64
onDestroy(() => view?.destroy());
65
66
function create_editor_view(): EditorView {
0 commit comments