Add missing getting-started steps
This commit is contained in:
parent
adaa95ebb8
commit
61eeaef226
@ -169,6 +169,9 @@ PORT=1234 node ./node_modules/y-websocket/bin/server.js
|
|||||||
### Example: Observe types
|
### Example: Observe types
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
import * as Y from 'yjs';
|
||||||
|
|
||||||
|
const doc = new Y.Doc();
|
||||||
const yarray = doc.getArray('my-array')
|
const yarray = doc.getArray('my-array')
|
||||||
yarray.observe(event => {
|
yarray.observe(event => {
|
||||||
console.log('yarray was modified')
|
console.log('yarray was modified')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user