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
Right now the style rules make it impossible to declare the type of "this" in a function.
When you do it like this:
function(this: UserDocument){}
it tells you to use an arrow function (Unexpected function expression.(prefer-arrow-callback)) that do not support to set "this".
I need this for mongoose virtuals where you can set virtual fields to the value returned by a callback function. You can access all document fields from "this" inside the function. In my use case, there is a virtual field named "makeJwt" which needs access to the jwtSecret stored in the UserDocument.
Is it intended to disallow this in functions in general?
The text was updated successfully, but these errors were encountered:
Right now the style rules make it impossible to declare the type of "this" in a function.
When you do it like this:
it tells you to use an arrow function (Unexpected function expression.(prefer-arrow-callback)) that do not support to set "this".
I need this for mongoose virtuals where you can set virtual fields to the value returned by a callback function. You can access all document fields from "this" inside the function. In my use case, there is a virtual field named "makeJwt" which needs access to the jwtSecret stored in the UserDocument.
Is it intended to disallow this in functions in general?
The text was updated successfully, but these errors were encountered: