-
Notifications
You must be signed in to change notification settings - Fork 3
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
Composition with optional chaining #8
Comments
Timely! Thanks for raising this. I will mention this in my upcoming presentation. And agreed of course. These must be able to be used together. |
good point // current valid syntaxes with optional-chaining and infix-bang
const foo = (await (await fetch(url)).json())?.foo // the json response could be "null"
const foo = (await fetch(url)!json())?.foo
// some ideas
const foo = await fetch(url)!json()!?foo // this ?
const foo = await fetch(url)!json()?!foo // that ?
const foo = await fetch(url)!json()!.foo // or that to keep similarity with optional-chaining dot? |
Just a quick note that !. should be considered unsuitable because it has a meaning in TypeScript as non-null assertion operator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assuming that optional chaining advances, this proposal will need to be able to work with optional chains.
The text was updated successfully, but these errors were encountered: