From 19aa4888bb08290c7a54282440241a738c01fb78 Mon Sep 17 00:00:00 2001 From: Maxime LUCE Date: Tue, 27 Feb 2024 13:39:36 +0100 Subject: [PATCH] docs: add `ready` event to README.md --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a7fbbd7..d559bc0 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,10 @@ To use `svelte-codemirror-editor`, you need to import the package and use it as ## Events -| Event | Type | Description | -| -------- | -------- | ----------------------------- | -| `change` | `string` | Trigger when the code changes | +| Event | Type | Description | +| -------- | ------------ | ------------------------------------------------------------------------------- | +| `change` | `string` | Trigger when the code changes. | +| `ready` | `EditorView` | Trigger when the editor is ready. Allows to retrieve the `EditorView` instance. | ## Usage with vite / svelte-kit @@ -118,6 +119,17 @@ const config = { /> ``` +### Get EditorView instance + +```svelte + + + view = e.detail} /> +``` + ## License [MIT](LICENSE)