Skip to content

Commit e415ce5

Browse files
committed
docs(js): show runForever() in the publish quickstart
1 parent dca2180 commit e415ce5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

js/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ const pub = publish({
2626
while (!pub.apiKey) await new Promise((r) => setTimeout(r, 50));
2727
console.log('URL:', `https://hub.example.com${pub.baseUrl}`);
2828
console.log('KEY:', pub.apiKey);
29+
30+
// Keep the publisher alive until you call pub.stop() (mirror of
31+
// Python's await pub.run_forever()).
32+
await pub.runForever();
2933
```
3034

3135
## Connect — chat from a browser/Node client

0 commit comments

Comments
 (0)