文件:
http://docs.meteor.com/#publish_userId
说
这是不变的.但是,如果登录用户更改,则使用新值重新运行发布功能.
是否有某种方法可以运行一些事件驱动的代码,仅在登录用户更改的事件中触发?
And*_*eas 11
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.