add way to nest commands

This commit is contained in:
Philipp Kühn
2020-09-21 00:14:59 +02:00
parent f6270c0e0c
commit 432b30f1a6
2 changed files with 20 additions and 6 deletions

View File

@@ -8,9 +8,6 @@ declare module '../Editor' {
}
}
export const clearContent: ClearContentCommand = (emitUpdate = false) => ({ editor }) => {
// TODO: doesnt work, we have to re-use `tr`
editor.setContent('', emitUpdate)
return true
export const clearContent: ClearContentCommand = (emitUpdate = false) => ({ commands }) => {
return commands.setContent('', emitUpdate)
}