Skip to content
Myr

Added FAQ section

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Michel Weststrate · committed by Michel Weststrate · parent a7b5df7 · Browse files · 1 file+28 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+28 added−0 removed

  • other:+28 added−0 removed

1 file+28 added−0 removed

modified:readme.md+28 added
226 unmodified lines
227* Immer is roughly as fast as ImmutableJS. However, the _immutableJS + toJS_ makes clear the cost that often needs to be paid later; converting the immutableJS objects back to plain objects, to be able to pass them to components, over the network etc... (And there is also the upfront cost of converting data received from e.g. the server to immutable JS)228* The ES5 implementation of Immer is significantly slower. For most reducers this won't matter, but reducers that process large amounts of data might benefit from not (or only partially) using an Immer producer. Luckily, Immer is fully opt-in.229* The peeks in the _frozen_ versions of _just mutate_, _deepclone_ and _naive reducer_ come from the fact that they recursively freeze the full state tree, while the other test cases only freeze the modified parts of the tree.230231## FAQ232233_(for those who skimmed the above instead of actually reading)_234235**Q: Does Immer use structural sharing? So that my selectors can be memoized and such?**236237A: Yes238239**Q: Does Immer support deep updates?**240241A: Yes242243**Q: I can't rely on Proxies being present on my target environments. Can I use Immer?**244245A: Yes246247**Q: Can I typecheck my data structures when using Immer?**248249A: Yes250251**Q: Can I store `Date` objects, functions etc in my state tree when using Immer?**252253A: Yes254255**Q: Is it fast?**256257A: Yes258259## Credits260261Special thanks goes to @Mendix, which supports it's employees to experiment completely freely two full days a month, which formed the kick-start for this project.262
3 unmodified lines