Question: How does this compare to seamless-immutable?
holyjak opened this issue · 2 comments
Hello,
I wonder whether I should pick seamless-immutable or icepick. They both seem to be doing the same thing, providing utilities for "modifying" deeply frozen data structures. I can see some differences but know too little to be able to really compare them and decide. Could you be so kind and describe the advantages of seamless over icepick and vice versa? Thanks a lot!
PS: I'll ask at the other project as well
These two are very similar in their goals, but differ in the API. seamless-immutable
overloads certain array methods, such as [].map
and [].filter
to return immutable values, but I leave the built-ins alone and instead provide icepick.map(arr, fn)
, icepick.filter(arr, fn)
, etc. functions (similar to how lodash/underscore do it). This is to make interop with other libraries easier -- other libraries might rely on the array built-ins returning mutable collections.
Overall the API is more like mori than a fluent/method-based API.
icepick
doesn't support freezing Date
s currently -- it will leave them as-is, unfrozen. I'm considering converting them to timestamps or ISO date strings. It also will throw if it is used with a collection with circular references -- doing that prevents some nasty bugs.
Thanks a lot! Perhaps it would be useful to add this to the README?