Constructor
new LiveQueryClient(options)
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object
|
|
Methods
close()
This method will close the WebSocket connection to this LiveQueryClient, cancel the auto reconnect and unsubscribe all subscriptions based on it.
open()
After open is called, the LiveQueryClient will try to send a connect request to the LiveQuery server.
subscribe(query, sessionToken) → {LiveQuerySubscription}
Subscribes to a ParseQuery
If you provide the sessionToken, when the LiveQuery server gets ParseObject's updates from parse server, it'll try to check whether the sessionToken fulfills the ParseObject's ACL. The LiveQuery server will only send updates to clients whose sessionToken is fit for the ParseObject's ACL. You can check the LiveQuery protocol here for more details. The subscription you get is the same subscription you get from our Standard API.
Parameters:
Name | Type | Description |
---|---|---|
query |
object
|
the ParseQuery you want to subscribe to |
sessionToken |
string
|
(optional) |
Returns:
- Type:
-
LiveQuerySubscription
subscription
unsubscribe(subscription)
After calling unsubscribe you'll stop receiving events from the subscription object.
Parameters:
Name | Type | Description |
---|---|---|
subscription |
object
|
subscription you would like to unsubscribe from. |