Javascript, all possible options how to (re)create/modify an immutable store (Redux) -


could please me possible options(or @ least most) on how modify store in redux?

example: object.assign(), (...spread operator) etc.

i need make personal cheat sheet , maybe others find here inspiration, if gets answered.

thanks

there's pretty 2 broad ways it. 1 you've covered making shallow copy of old state , changing values within new object, , second way making deep copy , changing values within new object.

there many different ways go doing each of these methods, importing library give deepclone method or making own.

the way you'd decide on better use case determine whether or not passing references between shallow copies break program or not.


Comments