Skip to content

refactoring from property access expressions to destructured values #30571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zpdDG4gta8XKpMCd opened this issue Mar 24, 2019 · 2 comments
Closed
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript

Comments

@zpdDG4gta8XKpMCd
Copy link

zpdDG4gta8XKpMCd commented Mar 24, 2019

so the goal of this refactoring is in saving some work typing when property access expressions need to be rewritten by hand to destructured values

examples:

declare const obj: { value: unknown; };
// before
const value = obj.value;
// after
const { value } = obj;
declare const obj: { value: unknown; };
declare function hereAndThere(here: unknown, there: unknown);
// before
hereAndThere(obj.value, obj.value);
// after
const { value } = obj;
hereAndThere(value, value);
@RyanCavanaugh RyanCavanaugh added Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript labels Mar 26, 2019
@zhuravlikjb
Copy link

Seems to be a duplicate of #29917.

@zpdDG4gta8XKpMCd
Copy link
Author

indeed very similar, closing in favor of #29917

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants