-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 #2738
base: master
Are you sure you want to change the base?
Solution #2738
Conversation
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.
check the comments
src/transformState.js
Outdated
for (const action of actions) { | ||
switch (action.type) { | ||
case 'addProperties': | ||
for (const data in action.extraData) { |
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.
The variable 'data' does not provide clarity on what it holds. Consider renaming it to something more meaningful like 'property'.
src/transformState.js
Outdated
} | ||
break; | ||
case 'removeProperties': | ||
for (const key of action.keysToRemove) { |
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.
The variable 'key' does not provide clarity on what it holds. Consider renaming it to something more meaningful like 'propertyName'.
@@ -5,7 +5,27 @@ | |||
* @param {Object[]} actions | |||
*/ | |||
function transformState(state, actions) { | |||
// write code here |
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.
Add a brief comment explaining what the function does, to improve code readability.
src/transformState.js
Outdated
} | ||
break; | ||
case 'clear': | ||
for (const key in state) { |
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.
The variable 'key' does not provide clarity on what it holds. Consider renaming it to something more meaningful like 'propertyName'.
src/transformState.js
Outdated
switch (action.type) { | ||
case 'addProperties': | ||
for (const data in action.extraData) { | ||
const prop = action.extraData[data]; |
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.
The variable 'prop' does not provide clarity on what it holds. Consider renaming it to something more meaningful like 'value'.
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.
well done
No description provided.