cleanup prosemirror example

This commit is contained in:
Kevin Jahns
2018-11-06 15:15:27 +01:00
parent 32b8fac37f
commit 31d6ef6296
5 changed files with 103 additions and 81 deletions

View File

@@ -31,7 +31,6 @@ export default class ProsemirrorBinding {
const updatedProps = {
dispatchTransaction: function (tr) {
// TODO: remove
const time = performance.now()
const newState = prosemirror.state.apply(tr)
mux(() => {
updateYFragment(yDomFragment, newState, mapping)
@@ -41,11 +40,9 @@ export default class ProsemirrorBinding {
} else {
prosemirror.updateState(newState)
}
console.info('time for Yjs update: ', performance.now() - time)
}
}
prosemirror.setProps(updatedProps)
yDomFragment.observeDeep(events => {
if (events.length === 0) {
return