node-ddp-client icon indicating copy to clipboard operation
node-ddp-client copied to clipboard

Changing a subscription

Open Taakn opened this issue 9 years ago • 1 comments

Hello,

I have a question: let's say I am subscribing and observing a collection that was based on a certain query with parameters .find({parameters}).

If I change my parameters, how can I refresh the subscription with the new parameters other than by unsubscribing/subscribing again?

Thanks so much!

Taakn avatar Feb 01 '16 23:02 Taakn

I guess what I'm doing now in pseudocode (and it's working), it's to:

subscriber = Subscribe(collection)
observer = Observe(query)

When I need to change my query:

observer.dispose()
observer = Observe(new query)

When I'm done, clean up:

observer.dispose()
subscriber.unsubscribe()

Would be great if someone could comment on what I'm doing and if it's correct/incorrect.

Thanks!

Taakn avatar Feb 02 '16 15:02 Taakn