Constructor
new LiveQuerySubscription()
Methods
unsubscribe()
closes the subscription
Creates a new LiveQuery Subscription. Extends events.EventEmitter cloud functions.
Open Event - When you call query.subscribe(), we send a subscribe request to the LiveQuery server, when we get the confirmation from the LiveQuery server, this event will be emitted. When the client loses WebSocket connection to the LiveQuery server, we will try to auto reconnect the LiveQuery server. If we reconnect the LiveQuery server and successfully resubscribe the ParseQuery, you'll also get this event.
subscription.on('open', () => { });
Create Event - When a new ParseObject is created and it fulfills the ParseQuery you subscribe, you'll get this event. The object is the ParseObject which is created.
subscription.on('create', (object) => { });
Update Event - When an existing ParseObject which fulfills the ParseQuery you subscribe is updated (The ParseObject fulfills the ParseQuery before and after changes), you'll get this event. The object is the ParseObject which is updated. Its content is the latest value of the ParseObject.
subscription.on('update', (object) => { });
Enter Event - When an existing ParseObject's old value doesn't fulfill the ParseQuery but its new value fulfills the ParseQuery, you'll get this event. The object is the ParseObject which enters the ParseQuery. Its content is the latest value of the ParseObject.
subscription.on('enter', (object) => { });
Update Event - When an existing ParseObject's old value fulfills the ParseQuery but its new value doesn't fulfill the ParseQuery, you'll get this event. The object is the ParseObject which leaves the ParseQuery. Its content is the latest value of the ParseObject.
subscription.on('leave', (object) => { });
Delete Event - When an existing ParseObject which fulfills the ParseQuery is deleted, you'll get this event. The object is the ParseObject which is deleted.
subscription.on('delete', (object) => { });
Close Event - When the client loses the WebSocket connection to the LiveQuery server and we stop receiving events, you'll get this event.
subscription.on('close', () => { });
closes the subscription