-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 #4122
base: master
Are you sure you want to change the base?
Develop #4122
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.
Thank you for your hard work on this pull request! 😊 There are a few critical issues that need to be addressed before we can approve it. The main concern is the direct mutation of the stateCopy
object within the switch
cases, which can lead to unintended side effects. It's important to ensure that each action works with a fresh copy of the state by pushing a new copy to the result
array after processing each action. Additionally, please add a default
case to the switch
statement for error handling and consider improving the naming conventions for better readability. Once these issues are resolved, your solution will be much stronger! Keep up the great work! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
for (const action of actions) { | ||
switch (action.type) { | ||
case 'addProperties': | ||
result.push(addProperties(stateCopy, 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.
Issue: The stateCopy
object is modified directly within the switch
cases. This can lead to unintended side effects as the same object is used for all actions.
Suggestion: Instead of pushing the result inside each case, modify the stateCopy
within the case and push a new copy of the modified state to the result
array after the switch
block, at the end of each loop iteration.
break; | ||
|
||
case 'removeProperties': | ||
result.push(removeProperties(stateCopy, 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.
Issue: The stateCopy
object is modified directly within the switch
cases. This can lead to unintended side effects as the same object is used for all actions.
Suggestion: Instead of pushing the result inside each case, modify the stateCopy
within the case and push a new copy of the modified state to the result
array after the switch
block, at the end of each loop iteration.
break; | ||
|
||
case 'clear': | ||
result.push(clear(stateCopy)); |
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.
Issue: The stateCopy
object is modified directly within the switch
cases. This can lead to unintended side effects as the same object is used for all actions.
Suggestion: Instead of pushing the result inside each case, modify the stateCopy
within the case and push a new copy of the modified state to the result
array after the switch
block, at the end of each loop iteration.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
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.
🔥
Привіт,тож все добре ? |
No description provided.