freezing.md
This file
Path
docs/freezing.md
19 lines · 1.4 KiB · Markdown
Last changed by
docs: fix video player scrolling on chrome, fixes #520Michel Weststratebefore adoptionfbae585
History of this fileTake it
Merge pull request #421 from immerjs/docsMichel Weststratebefore adoption9be6e46
lines 1–5why, one step back1---2id: freezing3title: Auto freezing4---5Added egghead.io video embedsMichel Weststratebefore adoptiona866760
lines 6–11why, one step back6<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 back12 <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 back13 </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>16Merge pull request #422 from xkxx/patch-1Michel Weststratebefore adoptionf37b6be
line 17why, one step back17Immer 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
lines 18–19why, one step back1819_⚠️ 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! ⚠️_