docs: update content

This commit is contained in:
Hans Pagel
2020-11-17 15:38:46 +01:00
parent 7e2f7f7a0f
commit 4579a15300
4 changed files with 48 additions and 32 deletions

View File

@@ -10,21 +10,21 @@ You can define your event listeners on a new editor instance right-away:
```js
const editor = new Editor({
onInit: () => {
onInit() {
// The editor is ready.
},
onUpdate: () => {
onUpdate() {
// The content has changed.
},
onFocus: () => {
onTransaction({ transaction }) {
// The editor state has changed.
},
onFocus({ event }) {
// The editor is focused.
},
onBlur: () => {
onBlur({ event }) {
// The editor isnt focused anymore.
},
onTransaction: ({ transaction }) => {
// The editor state has changed.
},
})
```
@@ -41,6 +41,10 @@ editor.on('update', () => {
// The content has changed.
}
editor.on('transaction', ({ transaction }) => {
// The editor state has changed.
}
editor.on('focus', () => {
// The editor is focused.
}
@@ -48,10 +52,6 @@ editor.on('focus', () => {
editor.on('blur', () => {
// The editor isnt focused anymore.
}
editor.on('transaction', ({ transaction }) => {
// The editor state has changed.
}
```
### Unbind event listeners