Description
Hello everyone, I'm using the JS-SDK(v1.8.4) with Parse-server(v2.2.9), I tried to subscribe
to multiple queries at the same app page, I've noticed that for example:
If I subscribe
only to Query A, I can later unsubscribe
(as in using the method) from Query A and all is good(no further events will emitted), but If I subscribe
to Query A, then I again subscribe
to Query B, and now I want to unsubscribe
from Query A, I can't, events will still emitted.
If I subscribe
to A then B, now I unsubscribe
from B, no no further events will emitted for B, but I can't unsubscribe from A, I can call unsubscribe but events for A will emitted.
I don't know if this supposed to work like that(not implemented feature), anyway I just wanted to know if its a valid behavior?, for now the workaround is to delete the event from the subscription object, for example:
let subscription = (new Parse.Query('ObjectName')).subscribe();
subscription.on('create', data => {})
delete subscription ._events.create;
In the A, B case, you could use unsubscribe
for B and delete
for A.