Closed testerez closed 7 years ago
To be honest, I haven't used Object.freeze
very much. But it looks like it does the job as well. I've seen some caveats where Object.freeze
could silently fail, but those are not the case if you use 'use strict';
in a modern browser. What I think is good of a custom approach, like this one, is that we have more freedom to track the path where the exception came from, and log a more useful error to the user in order to track where it came from.
Anyway, if we could achieve something similar with Object.freeze
, that'd be great, either applying that in this library or in the one you mentioned.
Thanks for your reply. I'll use redux-freeze until I found any limitation...
Cool, thanks for commenting!
I might be missing something but wouldn't it be enough to deep freeze the state like redux-freeze does?