Judging from this comment by David Glasser in the GitHub issues:
this.userId
is the primary API andMeteor.userId()
is syntactic sugar for users new to JavaScript who might not understand the details of successfully using this yet
It seems like we should use this.userId
whenever possible (such as inside a method function, where you can use both), and only use Meteor.userId()
inside publish functions. If this assumption is correct, why?
(Referring to the relevant bits of the code would also be helpful, I can't seem to find it)
Meteor.userId
vsMeteor.userId()
. This question is with regards tothis.userId
vsMeteor.userId()
– Spindlethis.userId
orMeteor.userId()
, why choose one over the other? – Spindle