The documentation:
http://docs.meteor.com/#publish_userId
says
This is constant. However, if the logged-in user changes, the publish function is rerun with the new value.
Is there some way of running some event driven code which fires only on the event that the logged in user changes?
Meteor.user()
, Meteor.userId()
and Meteor.userLoaded()
are all reactive datasources (documentation).
If you place them inside a template helper or build your own context around them, you'll notice when the current user changes.
You can also do it via Subscription and you can track the user and log inside the server. See my blog
Navigate to the code section in the blog post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With