fix websocket example
This commit is contained in:
parent
1e83b9418c
commit
775f6eed1d
@ -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')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user