-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add optional chaining to the babel preset
[Optional chaining](https://github.com/tc39/proposal-optional-chaining) allows to chain potentially null components. Instead of doing ``` if (window && window.location && window.location.protocol) { ssl = window.location.protocol } ``` we could do ``` ssl = window?.location?.protocol ``` The spec is stage 1 only but [they seem to have reach consensus](tc39/proposal-optional-chaining#75 (comment)) and [the formal stage 2 decision should be in March](tc39/proposal-optional-chaining#76 (comment)) There should not be any compatibility break
- Loading branch information
Showing
3 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
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
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
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