Skip to content

Commit

Permalink
Merge pull request #35 from davidbrochart/fix_readme
Browse files Browse the repository at this point in the history
Fix client example
  • Loading branch information
davidbrochart authored Sep 7, 2022
2 parents d77339e + 658d6c7 commit 4b9d51b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ from ypy_websocket import WebsocketProvider

async def client():
ydoc = Y.YDoc()
websocket = await connect("ws://localhost:1234/my-roomname")
WebsocketProvider(ydoc, websocket)
ymap = ydoc.get_map("map")
with ydoc.begin_transaction() as t:
ymap.set(t, "key", "value")
async with connect("ws://localhost:1234/my-roomname") as websocket:
WebsocketProvider(ydoc, websocket)
ymap = ydoc.get_map("map")
with ydoc.begin_transaction() as t:
ymap.set(t, "key", "value")

asyncio.run(client())
```
Expand Down

0 comments on commit 4b9d51b

Please sign in to comment.