Skip to content
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

look into using babel plugin for optional chaining #79

Open
DustinKLo opened this issue Jul 8, 2021 · 0 comments
Open

look into using babel plugin for optional chaining #79

DustinKLo opened this issue Jul 8, 2021 · 0 comments
Assignees

Comments

@DustinKLo
Copy link
Collaborator

optional chaining isn't supported in webpack 4 (only v5+) without using babel's optional chaining plugin
https://stackoverflow.com/a/66422985

optional chaining makes code a little more concise: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining

example code:

res.job &&
res.job.job_info &&
res.job.job_info.metrics &&
res.job.job_info.metrics.products_staged;

// would turn into

res?.job?.job_info?.metrics?.products_staged
@DustinKLo DustinKLo self-assigned this Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant