[Solved] Annoying issue with Meteor.publish and ES2015


Why is this.userId undefined when using ES2015 Arrow functions in Meteor.publish()?

If I use the old function() {} syntax, it works correctly.

It took me almost 30min of getting progresively more annoyed until I figured out what was the problem

Using Meteor 1.2.1.

EDIT: nvm, literally a minute after I posted I found the SO question… http://stackoverflow.com/questions/33056884/es6-arrow-function-is-changing-the-scope-of-this-in-meteor-publish