meteor / validated-method

Meteor methods with better scoping, argument checking, and good defaults.
https://atmospherejs.com/mdg/validated-method
MIT License
194 stars 28 forks source link

This with arrow functions #5

Closed elie222 closed 8 years ago

elie222 commented 8 years ago

Some of the examples use arrow functions, but 'this' won't work properly in the arrow functions. For example this.userId won't work in the arrow function.

The examples with arrow functions are therefore misleading and should be removed IMO, even if they don't actually make use of 'this'.

Unless I'm mistaken about how arrow functions work.

stubailo commented 8 years ago

I can't find the examples you're referring to. We use arrow functions for the method callback, but we always use method shorthand for the run method which is where you would use this.userId.

stubailo commented 8 years ago

Going to close this for now, since I don't think this is actually an issue.