fix websocket example

This commit is contained in:
Kevin Jahns 2019-06-02 15:16:14 +02:00
parent 1e83b9418c
commit 775f6eed1d

View File

@ -86,9 +86,7 @@ import { WebsocketProvider } from 'y-websocket'
import { TextareaBinding } from 'y-textarea' import { TextareaBinding } from 'y-textarea'
const doc = Y.Doc() const doc = Y.Doc()
const provider = new WebsocketProvider('http://localhost:1234', 'roomname') const provider = new WebsocketProvider('ws://localhost:1234', 'roomname', doc)
// sync all document updates through the websocket connection
provider.sync('doc')
// Define a shared type on the document. // Define a shared type on the document.
const ytext = doc.getText('my resume') const ytext = doc.getText('my resume')