update room-name in readme
This commit is contained in:
parent
bcc1c6380a
commit
fcc52ff25c
1 changed files with 4 additions and 3 deletions
|
@ -22,8 +22,9 @@ import * as Y from 'yjs'
|
||||||
import { WebrtcProvider } from '../src/y-webrtc.js'
|
import { WebrtcProvider } from '../src/y-webrtc.js'
|
||||||
|
|
||||||
const ydoc = new Y.Doc()
|
const ydoc = new Y.Doc()
|
||||||
const provider = new WebrtcProvider('prosemirror', ydoc)
|
// clients connected to the same room-name share document updates
|
||||||
const yarray = ydoc.get('prosemirror', Y.XmlFragment)
|
const provider = new WebrtcProvider('your-room-name', ydoc)
|
||||||
|
const yarray = ydoc.get('array', Y.Array)
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Signalling
|
##### Signalling
|
||||||
|
@ -38,7 +39,7 @@ PORT=4444 node ./bin/server.js
|
||||||
Peers using the same signalling server will find each other. You can specify several custom signalling servers like so:
|
Peers using the same signalling server will find each other. You can specify several custom signalling servers like so:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const provider = new WebrtcProvider('prosemirror', ydoc, { signalling: ['wss://y-webrtc-ckynwnzncc.now.sh', 'ws://localhost:4444'] })
|
const provider = new WebrtcProvider('your-room-name', ydoc, { signalling: ['wss://y-webrtc-ckynwnzncc.now.sh', 'ws://localhost:4444'] })
|
||||||
```
|
```
|
||||||
|
|
||||||
### Logging
|
### Logging
|
||||||
|
|
Loading…
Reference in a new issue