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
{{ message }}
Repository navigation
Destructure of function parameters - Refactoring #24827
There's a big difference between your two examples though. In the first one target is a constant, but not in the second one. Destructured variables in function parameters can be reassigned.
James Wyatt Cready-Pyle (@jcready) Oh, I do not know why it seemed to me that it was different.
This somewhat limits this proposed refactoring function. : |
Actually, you can do it somehow? Or are there any standard plans for this?
Activity
Shinigami92 commentedon Jun 9, 2018
But shouldn't it be
event.target?to
lukaszpolowczyk commentedon Jun 9, 2018
Shinigami (@Shinigami92) Of course (May optionally be
const {target} = event).Sorry for the mistake.
jcready commentedon Jun 9, 2018
There's a big difference between your two examples though. In the first one
targetis a constant, but not in the second one. Destructured variables in function parameters can be reassigned.lukaszpolowczyk commentedon Jun 9, 2018
James Wyatt Cready-Pyle (@jcready) Oh, I do not know why it seemed to me that it was different.
This somewhat limits this proposed refactoring function. : |
Actually, you can do it somehow? Or are there any standard plans for this?
Kingwl commentedon Aug 24, 2020
Hi folks.
There's a similar refactor #39832 that do not convert at the original position but append new line below
lukaszpolowczyk commentedon Aug 24, 2020
Wenlu Wang (@Kingwl) What about function parameter destructure? And it looks like it works in one direction.
Kingwl commentedon Aug 25, 2020
Well, It's good to take a try.