How avoid inner nested object mutations in js? [DEEP COPY]
As no SQL database are is cool, I want to store document which comes from firebase to redux as a state, in my case document(data) is many objects which is nested inside each other. [Question]: objects are reference value type in Javascript, how could I prevents from object and its nested objects from mutations? There some solutions: 1. freeze method applied for the outer object but doesn't effect the inner nested objects. 2. spreed operator creats a shallow copy, but you have to spreed each nested obeject to prevents mutation, its tasks alots of time and make my code ugly and hard to handle. 3. There are some libraries which makes my app heavy. đ§đ€ [Conclusion]: is there any pure Javascript pattern or algorithm to handle the original object and its nested objects mutations and we could use from its copy over and over again. https://code.sololearn.com/cMTf3r8asSm3/?ref=app