pass editor to sendable hook

This commit is contained in:
Philipp Kühn
2019-05-10 15:37:21 +02:00
parent a1f94056cf
commit 80144815a9
2 changed files with 8 additions and 5 deletions

View File

@@ -69,8 +69,8 @@ export default {
// debounce changes so we can save some bandwidth // debounce changes so we can save some bandwidth
debounce: 250, debounce: 250,
// onSendable is called whenever there are changed we have to send to our server // onSendable is called whenever there are changed we have to send to our server
onSendable: data => { onSendable: ({ sendable }) => {
this.socket.emit('update', data) this.socket.emit('update', sendable)
}, },
}), }),
], ],

View File

@@ -19,9 +19,12 @@ export default class Collaboration extends Extension {
if (sendable) { if (sendable) {
this.options.onSendable({ this.options.onSendable({
version: sendable.version, editor: this.editor,
steps: sendable.steps.map(step => step.toJSON()), sendable: {
clientID: sendable.clientID, version: sendable.version,
steps: sendable.steps.map(step => step.toJSON()),
clientID: sendable.clientID,
},
}) })
} }
}, this.options.debounce) }, this.options.debounce)