You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why decrement hp is a pure function if it modifies input argument - const decrementHP = p => p.set('hp', p.get('hp') - 1);
For it to be pure shouldn't it at least copy the map content before changing the value? If you run this in multithreaded env you will get a lot of troubles.
The text was updated successfully, but these errors were encountered:
The code does not actually indicate that it mutates p. It could very well simply return a new 'p' with the value changed, leaving the original unchanged.
Why decrement hp is a pure function if it modifies input argument -
const decrementHP = p => p.set('hp', p.get('hp') - 1);
For it to be pure shouldn't it at least copy the map content before changing the value? If you run this in multithreaded env you will get a lot of troubles.
The text was updated successfully, but these errors were encountered: