Closed sirpy closed 6 years ago
Yeah, that's how arrow functions work... Arrow functions don't have their own this
and can't be given (bound) a new this value, it always uses the this
in the context of where it was defined.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
Here you can read up on arrow functions.
When using an arrow function: (userId,doc..) => {}, this.previous is not defined function(userId,doc...) {} works just fine