Freeze-Mutate: An Immutable Object Management Library for JS and TS
- Mutate a frozen object with a change-set and you get a new frozen object that is a merge, or an overlay, of a change-set on top of the original object. Again, this is a deep-merge that also works with Arrays, Sets, Maps, and your own custom classes. For the brave: you can provide custom freeze and merge functions.
- Using Typescript you get all the goodies of generics, enforcing the validity of the change-set, Readonly returned types and interfaces for the custom functions.
Enough talking. Let’s dive in…
Deep-freezing and merging of objects and Arrays during mutation:
Support for Set and Map and class objects (aka you might want to skip immutable.js)
Support for cyclic objects
Even more interesting cyclic objects…
For Typescript we have here some more goodies!
- Zero dependencies and just 2 KB pkg.
- Can be loaded in a browser.
- Be careful with mutating large objects, arrays and Maps — this is heavy!
- Code is fully covered with jest tests.
For more details head for the readme on git
You are welcome to star/clap/like/share to show me how awesome you are and help others find this lib. ;-)
eram at weblegions dot com
Originally published at github.com.