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

Develop #3920

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

Develop #3920

wants to merge 3 commits into from

Conversation

mgsorigo
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on the pull request! 🎉 While there are some naming suggestions to improve code readability, they don't impact the functionality. Keep up the good work and consider the feedback for future improvements!

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

@@ -7,7 +7,32 @@
* @return {Object[]}
*/
function transformStateWithClones(state, actions) {
// write code here
const array = [];

Choose a reason for hiding this comment

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

Naming issue: The variable 'array' should have a more descriptive name, such as 'stateHistory', to better reflect its purpose.

@@ -7,7 +7,32 @@
* @return {Object[]}
*/
function transformStateWithClones(state, actions) {
// write code here
const array = [];
const newState = { ...state };

Choose a reason for hiding this comment

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

Naming issue: The variable 'newState' should be named 'stateCopy' to better indicate that it is a copy of the state.

const array = [];
const newState = { ...state };

for (const { type, ...rest } of actions) {

Choose a reason for hiding this comment

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

Consider using a switch statement instead of multiple if statements for handling the 'type' property. This will make the code cleaner and more maintainable.

}
}

const newState1 = { ...newState };

Choose a reason for hiding this comment

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

Naming issue: The variable 'newState1' should have a more descriptive name, such as 'stateSnapshot', to better reflect its purpose.

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