Created
October 13, 2021 17:14
-
-
Save brasten/58e273f63982fbd3f1e22d95f662d3c7 to your computer and use it in GitHub Desktop.
Destructuring and Typing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass { | |
// if destructured renaming wasn't a thing, this is | |
// what I'd naturally expect. But it's already | |
// valid JS syntax for renaming, obviously. | |
constructor({ coreService: CoreService }) { | |
//... | |
} | |
// maybe-ish? | |
constructor({ coreService as CoreService }) { | |
//... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment