cudr_slate-collaborative/packages/client/src/onChange.ts

14 lines
305 B
TypeScript
Raw Normal View History

2019-10-05 08:44:49 +00:00
import { ExtendedEditor } from './model'
const onChange = opts => (editor: ExtendedEditor, next: () => void) => {
2019-10-10 19:45:31 +00:00
if (editor.connection && !editor.remote) {
2019-10-05 09:07:11 +00:00
const operations: any = editor.operations
editor.connection.receiveSlateOps(operations)
2019-10-05 08:44:49 +00:00
}
return next()
}
export default onChange