-
Notifications
You must be signed in to change notification settings - Fork 91
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
refactor: flatten nested if-else blocks #6
base: master
Are you sure you want to change the base?
Conversation
Need to check the effect on filesize, but I'd imagine this is a savings! (due to uglify better optimizing early returns than nested conditionals) |
src/index.js
Outdated
} | ||
|
||
Promise.resolve(() => method.apply(null, data.params)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @cades - that nested |
@developit thanks for point that out! Seems my knowledge to |
apply "return early, avoid else" practice to make code simple and easy to read