Closed
Description
I am using live queries to realize the realtime chat app, but I could not find the method to detect a user is online or offline. I am also confused with the enter
and leave
events.
subscription.on('enter', (object) => {
console.log('object entered');
});
When an existing ParseObject's old value does not 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('leave', (object) => {
console.log('object left');
});
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.
I wonder when to trigger these two events. Thanks in advance!