feat: extract cursor component

This commit is contained in:
cudr
2019-10-14 00:49:28 +03:00
parent 0ceb38bbfd
commit 21a4a7d99a
14 changed files with 105 additions and 104 deletions

View File

@@ -1,4 +1,4 @@
import { Operation, SyncDoc } from '../model'
import { Operation, SyncDoc } from '../model/index'
export const addAnnotation = (doc: SyncDoc, op: Operation): SyncDoc => {
console.log('addAnnotation!!!', op.toJS())

View File

@@ -21,7 +21,10 @@ export const applyOperation = (doc: SyncDoc, op: Operation): SyncDoc => {
try {
const applyOp = opType[op.type]
if (!applyOp) throw new TypeError('Unsupported operation type!')
if (!applyOp) {
console.log('operation', op.toJS())
throw new TypeError(`Unsupported operation type: ${op.type}!`)
}
return applyOp(doc, op)
} catch (e) {