Remove in subscription does not remove in client collection


#1

Hello,

I have a basic question regarding subscriptions and client collections.
When I subscribe to a collection and one element is published then I can find the element on the client as expected. Then I change the same subscription so that no element is published anymore. I would have expected that the element mentioned before can’t be found on client collection anymore. But it is still there. Shouldn’t it be removed from the client collection automagically?


#2

How do you “change same subscription” ? Can you show some code ?


#3

Thanks for your help. I found the problem.
I triggered the subscribe handler by some Google Maps event inside the onCreated method. It wasn’t in a reactive data context. I now just change a reactive var inside the event handler and update the subscription in an autorun block. The client collection is gets synced as expected. I guess a Meteor beginner mistake :frowning: