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

Solution #2284

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Solution #2284

wants to merge 3 commits into from

Conversation

anpiet
Copy link

@anpiet anpiet commented Apr 23, 2023

No description provided.

Copy link

@AndrzejPec AndrzejPec left a comment

Choose a reason for hiding this comment

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

I've found 3 cases of checklist violation, see if there be more, I'm not sure :)

};

if (actions[i][key] === 'removeProperties') {
for (const key1 in actions[i]['keysToRemove']) {

Choose a reason for hiding this comment

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

according to the checklist: 1. [CODE STYLE]: don't use for in loop for iterating over array

function transformState(state, actions) {
// write code here
for (let i = 0; i < actions.length; i++) {
for (const key in actions[i]) {

Choose a reason for hiding this comment

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

according to checklist 5. [CODE STYLE]: Nested loops === EVIL.

Avoid evil ;)

// write code here
for (let i = 0; i < actions.length; i++) {
for (const key in actions[i]) {
if (actions[i][key] === 'addProperties') {

Choose a reason for hiding this comment

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

according to the checklist: 2. [CODE STYLE]: Use switch statement if you have limited amount of conditions.

@anpiet anpiet closed this Jul 25, 2023
@anpiet anpiet reopened this Jul 25, 2023
@anpiet anpiet requested a review from AndrzejPec July 25, 2023 16:15
Copy link

@AndrzejPec AndrzejPec left a comment

Choose a reason for hiding this comment

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

lookin' all good, only one small improvement suggested :)

src/transformState.js Outdated Show resolved Hide resolved
@anpiet anpiet requested a review from AndrzejPec July 25, 2023 20:00
Copy link

@choeqq choeqq left a comment

Choose a reason for hiding this comment

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

Good job ✅

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.

3 participants