Refactor constructor's "this" function statements into class methods Follow
How to convert this:
class MyClass {
constructor() {
this.method = ( x, y ) => {
if ( x === 'value' ) {
return y;
}
};
this.method('value', 1);
}
}
Into this:
class MyClass {
constructor() {
this.method('value', 1);
}
method( x, y ) {
if ( x === 'value' ) {
return y;
}
};
}
I have tons of legacy code and it would be very convinient if there is any possibility to refactor this cases automatically.
Please sign in to leave a comment.
No, there are no such refactorings.