Skip to content

Commit 1bc0bb3

Browse files
davimacedodplewis
authored andcommitted
Fix doc for creating a subscription in javascript (#658)
* Fix doc for creating a subscription in javascript * Note about release 2.3.0
1 parent e7dead6 commit 1bc0bb3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

_includes/js/live-queries.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ Note: Live Queries is supported only in [Parse Server](https://github.com/parse-
99

1010
```javascript
1111
let query = new Parse.Query('Game');
12-
let subscription = query.subscribe();
12+
let subscription = await query.subscribe();
1313
```
1414

15+
* Since release `2.3.0` of Parse JS SDK, the `query.subscribe()` function returns a `Promise` that resolves to the subscription object. Previous releases return the subscription object directly and require you to write `let subscription = query.subscribe();` instead.
16+
1517
The subscription you get is actually an event emitter. For more information on event emitter, check [here](https://nodejs.org/api/events.html). You'll get the LiveQuery events through this `subscription`. The first time you call subscribe, we'll try to open the WebSocket connection to the LiveQuery server for you.
1618

1719
## Event Handling

0 commit comments

Comments
 (0)