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
As discussed in #64 we agreed that it might have a sense to add new optional setting, called for example requireThisBinding which would require using current module's methods instead of custom ones.
Example with requireThisBinding = true:
// Good
user.save().then(this._reloadPage.bind(this));
// Good
user.save().then(() => this._reloadPage());
// Bad
user.save().then(reloadPage.bind(this));
// Bad
user.save().then(() => reloadPage());
Default setting would be false so all of the above examples will work fine and we'll keep it backwards compatible.
I don't have any better name for the setting in my mind at this moment, so feel free to add your propositions in comments.
The text was updated successfully, but these errors were encountered:
michalsnik
changed the title
Add optional requireThisBinding in named-functions-in-promises
Add optional requireThisBinding in named-functions-in-promises rule
May 24, 2017
As discussed in #64 we agreed that it might have a sense to add new optional setting, called for example
requireThisBinding
which would require using current module's methods instead of custom ones.Example with
requireThisBinding = true
:Default setting would be
false
so all of the above examples will work fine and we'll keep it backwards compatible.I don't have any better name for the setting in my mind at this moment, so feel free to add your propositions in comments.
The text was updated successfully, but these errors were encountered: