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

Consider changing this mutation #67

Open
tonylomaxtk opened this issue Nov 14, 2023 · 0 comments
Open

Consider changing this mutation #67

tonylomaxtk opened this issue Nov 14, 2023 · 0 comments

Comments

@tonylomaxtk
Copy link

It's generally bad to mutate objects in this way, I had to run the code myself to check it which is a bad sign.

To be clear, don't mutate (change) the properties of objects in the data object. When you read the "PUT" request with the original data it's not immediately obvious what's changed. It works but it's hard to read and harder to debug. Be explicit about creating a copy of the user data with the new data and sending that back to your DynamoDB

currentPlayer.player_drawing = imageUrl;

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

No branches or pull requests

1 participant