1. React
  2. JSNation
  3. 2019
  4. Immer, Immutability and the Wonderful World of Proxies

Immer, Immutability and the Wonderful World of Proxies

JavaScript Proxies are fun and powerful, but you should probably never use them! Learn why. Plus, see how Immer makes working with immutability easy,

Michel Weststrate at JSNation 2019

Immer is a tiny package that allows you to work with immutable data structures with unprecedented ease. It doesn't require learning new data structures or update APIs, but instead creates a temporarily draft tree which can be modified using the standard JavaScript APIs. Immer makes all the ceremony that is needed to perform deep updates in immutable objects obsolete. Brace yourself; for example your Redux reducers will become twice as short without giving up on any of the semantic constraints. Immer (optionally) uses proxies under the hood. Proxies are an exotic JavaScript feature that is nowadays available in all modern browsers. What are they, how do they work and why should you (not) use them? How did they make Immer possible? Join this talk to learn how you can finally use immutability in JavaScript without fighting the language. Or just to get an idea about the powerful patterns that are possible nowadays in JavaScript, by using proxies.