add commands experiment

This commit is contained in:
Philipp Kühn
2021-01-21 12:13:20 +01:00
parent 001e5b7579
commit a2d5eef6b2
8 changed files with 305 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { Command, Range } from '../types'
/**
* Delete a given range.
*/
export const deleteRange = (range: Range): Command => ({ tr, dispatch }) => {
const { from, to } = range
if (dispatch) {
tr.delete(from, to)
}
return true
}