Websocket Provider for Yjs. Creates a websocket connection to sync the shared document. The document name is attached to the provided url. I.e. the following example creates a websocket connection to http://localhost:1234/my-document-name
import * as Y from 'yjs'import { YSweetProvider } from 'y-websocket'const doc = new Y.Doc()const provider = new YSweetProvider('http://localhost:1234', 'my-document-name', doc) Copy
import * as Y from 'yjs'import { YSweetProvider } from 'y-websocket'const doc = new Y.Doc()const provider = new YSweetProvider('http://localhost:1234', 'my-document-name', doc)
server url
room name
Y.Doc instance
options
Some desc.
Emit a named event. All registered event listeners that listen to the specified name will receive the event.
The event name.
The arguments that are applied to the event listener.
This should catch exceptions
Websocket Provider for Yjs. Creates a websocket connection to sync the shared document. The document name is attached to the provided url. I.e. the following example creates a websocket connection to http://localhost:1234/my-document-name
Example