-
Notifications
You must be signed in to change notification settings - Fork 28
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
adjusting handleDynamicStyle
#332
Conversation
…efore running the test
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.
Looks like a good solution 🙂
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.
💃 with a small recommendation
if (params) { | ||
if (params.data) { | ||
if (test(params)) { | ||
return style; | ||
} | ||
} | ||
} |
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.
It's syntax sugar, but you can remove a nested if
with:
if (params) { | |
if (params.data) { | |
if (test(params)) { | |
return style; | |
} | |
} | |
} | |
if (params?.data) | |
if (test(params)) { | |
return style; | |
} | |
} |
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.
This doesn't lint, otherwise I would have done it.
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.
Plausibly because we're supporting old versions of JS. Feel free to ignore this comment then and merge!
adjusting
handleDynamicStyle
to check if theparams.data
exists before running the testcloses #321