node-ddp-client
node-ddp-client copied to clipboard
Changing a subscription
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!
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!