Skip to content

Live queries, multiple subscription at once, is it me or it's not implemented at the moment? #1767

Closed
@avielfedida

Description

@avielfedida

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions