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

modified loop and conditional code #23

Merged
merged 2 commits into from
Oct 22, 2022
Merged

Conversation

ayodeji-ti
Copy link

No description provided.

propsNames: string[],
childComponent: IComponent,
) => {
) => any = (propsNames: string[], childComponent: IComponent) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why any?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its possible the type is a string, I'll change it to boolean | string

childComponent,
)}? <>${buildSingleBlock({
content += `{${
returnConditionalValue(propsNames, childComponent) === true ||

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not typeof?

)}? <>${buildSingleBlock({
content += `{${
returnConditionalValue(propsNames, childComponent) === true ||
returnConditionalValue(propsNames, childComponent) === false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract the value in variable first. See if you can improve the code, its not readable

childComponent,
)}})[0].map((item${childComponent.id.slice(
content += `{${
typeof returnLoopValue(propsNames, childComponent) === 'object'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments as above

childComponent,
)}? <>${buildSingleBlock({
content += `{${
returnConditionalValue(propsNames, childComponent) === true ||

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

childComponent,
)}].map((item${childComponent.id.slice(
content += `{${
typeof returnLoopValue(propsNames, childComponent) === 'object'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above. Try to refactor duplicates

@ayodeji-ti ayodeji-ti merged commit d2babb7 into master Oct 22, 2022
@ayodeji-ti ayodeji-ti deleted the fix/loop-conditional branch November 7, 2022 15:33
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

Successfully merging this pull request may close these issues.

2 participants