You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Node js moving to es6, it would be great if arrow function works when defining instanceMethods.
module.exports=(sequelize,DataTypes)=>{constUser=sequelize.define('User',{name: DataTypes.STRING},{instanceMethods: {foo: ()=>{// this is not gonna work as expectedreturnthis.name}}});returnUser;};
What do you expect to happen?
above code to work.
What is actually happening?
I may be wrong. I think the lexical scoping is not working in our favor here.
The text was updated successfully, but these errors were encountered:
What you are doing?
With Node js moving to es6, it would be great if arrow function works when defining instanceMethods.
What do you expect to happen?
above code to work.
What is actually happening?
I may be wrong. I think the lexical scoping is not working in our favor here.
The text was updated successfully, but these errors were encountered: