-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Destructure parameters and type at the same time. #34748
Labels
Duplicate
An existing issue was already created
Comments
You might want to check out the relevant issue template. |
thanks @MartinJohns, It still stands though, I haven't seen other comments about why brackets couldn't be used. |
See #29526 for discussion of this topic |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
name: Destructure function parameters review
about: Allow types to be added to destructured function parameters for better readability
Despite what https://github.com/Microsoft/TypeScript/wiki/FAQ#functions says, can we not type cast parameters using instead?
I destructure my parameters a lot, and having to create another curly brace afterwards makes the code messy. I abstract the parameter type to an interface most of the time, but in some cases, it would just be nicer to add types right there whilst destructuring.
so how about...
with alias'
with optional
with defaults
with defaults and alias
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: