Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion _includes/js/live-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ Note: Live Queries is supported only in [Parse Server](https://github.com/parse-

```javascript
let query = new Parse.Query('Game');
let subscription = query.subscribe();
let subscription = await query.subscribe();
```

* 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.

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.

## Event Handling
Expand Down