diff --git a/examples/Components/Routes/Collaboration/index.vue b/examples/Components/Routes/Collaboration/index.vue index 5fcd7940..9081e9b9 100644 --- a/examples/Components/Routes/Collaboration/index.vue +++ b/examples/Components/Routes/Collaboration/index.vue @@ -69,8 +69,8 @@ export default { // debounce changes so we can save some bandwidth debounce: 250, // onSendable is called whenever there are changed we have to send to our server - onSendable: data => { - this.socket.emit('update', data) + onSendable: ({ sendable }) => { + this.socket.emit('update', sendable) }, }), ], diff --git a/packages/tiptap-extensions/src/extensions/Collaboration.js b/packages/tiptap-extensions/src/extensions/Collaboration.js index ab105209..785259bb 100644 --- a/packages/tiptap-extensions/src/extensions/Collaboration.js +++ b/packages/tiptap-extensions/src/extensions/Collaboration.js @@ -19,9 +19,12 @@ export default class Collaboration extends Extension { if (sendable) { this.options.onSendable({ - version: sendable.version, - steps: sendable.steps.map(step => step.toJSON()), - clientID: sendable.clientID, + editor: this.editor, + sendable: { + version: sendable.version, + steps: sendable.steps.map(step => step.toJSON()), + clientID: sendable.clientID, + }, }) } }, this.options.debounce)