Skip to content
Myr

freezing.md

This file

Path

docs/freezing.md

21 lines · 1.5 KiB · Markdown

Last changed by

Immer 7Michel Weststratebefore adoption467ea5d

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

Added egghead.io video embedsMichel Weststratebefore adoptiona866760

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

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

line 12why, one step back
12 <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 13–16why, one step back
13 </div>
14 <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>15</details>16

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

line 17why, one step back
17Immer 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 18why, one step back
18

Immer 7Michel Weststratebefore adoption467ea5d

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

Merge pull request #421 from immerjs/docsMichel Weststratebefore adoption9be6e46

line 21why, one step back
21_⚠️ 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! ⚠️_