Skip to content
Myr

freezing.md

This file

Path

docs/freezing.md

23 lines · 1.6 KiB · Markdown

Last changed by

docs: updated sponsor linksMichel Weststratebefore adoptionf97d037

History of this file

Take it

Merge pull request #421 from immerjs/docsMichel Weststratebefore adoption9be6e46

lines 1–5why, one step back
1---
2id: freezing3title: Auto freezing4---5

docs: updated sponsor linksMichel Weststratebefore adoptionf97d037

lines 6–8why, one step back
6<center>
7<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8</center>

Added egghead.io video embedsMichel Weststratebefore adoptiona866760

lines 9–13why, one step back
9
10<details>11 <summary style="color: white; background:#c200c2;padding:5px;margin:5px;border-radius:2px">egghead.io lesson 7: Immer automatically freezes data</summary>12 <br>13 <div style="padding:5px;">

docs: fix video player scrolling on chrome, fixes #520Michel Weststratebefore adoptionfbae585

line 14why, one step back
14 <iframe style="border: none;" width=760 height=427 scrolling="no" src="https://egghead.io/lessons/javascript-produces-immutable-data-and-avoid-unnecessary-creation-of-new-data-trees-with-immer/embed" ></iframe>

Added egghead.io video embedsMichel Weststratebefore adoptiona866760

lines 15–18why, one step back
15 </div>
16 <a style="font-style:italic;padding:5px;margin:5px;" href="https://egghead.io/lessons/javascript-produces-immutable-data-and-avoid-unnecessary-creation-of-new-data-trees-with-immer">Hosted on egghead.io</a>17</details>18

Merge pull request #422 from xkxx/patch-1Michel Weststratebefore adoptionf37b6be

line 19why, one step back
19Immer automatically freezes any state trees that are modified using `produce`. This protects against accidental modifications of the state tree outside of a producer. This comes with a performance impact, so it is recommended to disable this option in production. By default, it is turned on during local development and turned off in production. Use `setAutoFreeze(true / false)` to explicitly turn this feature on or off.

Merge pull request #421 from immerjs/docsMichel Weststratebefore adoption9be6e46

line 20why, one step back
20

Immer 7Michel Weststratebefore adoption467ea5d

lines 21–22why, one step back
21Immer will never freeze (the contents of) non-enumerable, non-own or symbolic properties, unless their content was drafted.
22

Merge pull request #421 from immerjs/docsMichel Weststratebefore adoption9be6e46

line 23why, one step back
23_⚠️ If auto freezing is enabled, recipes are not entirely side-effect free: Any plain object or array that ends up in the produced result, will be frozen, even when these objects were not frozen before the start of the producer! ⚠️_