mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-15 02:59:01 +08:00
refactoring
This commit is contained in:
parent
a614f0cce1
commit
0a98827b4c
@ -51,7 +51,7 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.socket = io('wss://tiptap-sockets.glitch.me')
|
this.socket = io('wss://tiptap-sockets.glitch.me')
|
||||||
.on('init', data => this.onInit(data))
|
.on('init', data => this.onInit(data))
|
||||||
.on('update', data => this.editor.extensions.options.collaboration.onUpdate(data))
|
.on('update', data => this.editor.extensions.options.collaboration.update(data))
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
@ -26,7 +26,7 @@ export default class CollaborationExtension extends Extension {
|
|||||||
clientID: Math.floor(Math.random() * 0xFFFFFFFF),
|
clientID: Math.floor(Math.random() * 0xFFFFFFFF),
|
||||||
debounce: 250,
|
debounce: 250,
|
||||||
onSendable: () => {},
|
onSendable: () => {},
|
||||||
onUpdate: ({ steps, version }) => {
|
update: ({ steps, version }) => {
|
||||||
const { state, view, schema } = this.editor
|
const { state, view, schema } = this.editor
|
||||||
|
|
||||||
if (getVersion(state) > version) {
|
if (getVersion(state) > version) {
|
||||||
|
Loading…
Reference in New Issue
Block a user