Commands for refactoring functions
const foo = () => 'foo!'
Position cursor anywhere in the arrow function and then run the Convert arrow function body to block statement command.
const foo = () => {
return 'foo!'
}
The inverse of the above. The function body must consist only of
a return
statement or this will error out.
const foo = () => {
return 'foo!'
}
Position cursor anywhere in the arrow function and then run the Convert arrow function body to expression command.
const foo = () => 'foo!'