docs: updated sponsor links
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 f3f7f1f · Browse files · 24 files·+71 added−25 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
24 files+71 added−25 removed
- other:+71 added−25 removed
Provenance
- Commit
f97d037- Tree
8ff9901- Author
Michel Weststrate <mweststrate@fb.com>- Committer
Michel Weststrate <mweststrate@fb.com>- Parent
f3f7f1f
24 files changed+71 added−25 removed
modified:docs/api.md+3 added-1 removed
123456678910111239 unmodified lines---id: apititle: API overview---
<div id="codefund"><!-- fallback content --></div><center><div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div></center>
| Exported name | Description | Section || --- | --- | --- || `(default)` | The core API of Immer, typically named `produce`: `import produce from "immer"` | [Produce](produce.md) |39 unmodified linesmodified:docs/async.md+3 added-1 removed
2 unmodified lines345677891011121343 unmodified lines2 unmodified linestitle: Async producers & createDraft / finishDraftsidebar_label: Async produce / createDraft---
<div id="codefund"><!-- fallback content --></div><center><div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div></center>
<details> <summary style="color: white; background:#c200c2;padding:5px;margin:5px;border-radius:2px">egghead.io lesson 11: Creating _async_ producers (and why you shouldn’t)</summary> <br>43 unmodified linesmodified:docs/built-with.md+4 added-2 removed
12345667891011125 unmodified lines18192021202223---id: built-withtitle: Built with Immer---
<div id="codefund"><!-- fallback content --></div><center><div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div></center>
- [react-copy-write](https://github.com/aweary/react-copy-write) _Immutable state with a mutable API_- [redux-toolkit](https://github.com/reduxjs/redux-toolkit) _The official, opinionated, batteries-included toolset for efficient Redux development_- [immer based handleActions](https://gist.github.com/kitze/fb65f527803a93fb2803ce79a792fff8) _Boilerplate free actions for Redux_5 unmodified lines- [immer-reducer](https://github.com/epeli/immer-reducer) _Type-safe and terse React (useReducer()) and Redux reducers with Typescript_- [redux-ts-utils](https://github.com/knpwrs/redux-ts-utils) _Everything you need to create type-safe applications with Redux with a strong emphasis on simplicity_- [react-state-tree](https://github.com/suchipi/react-state-tree) _Drop-in replacement for useState that persists your state into a redux-like state tree_- [redux-immer](https://github.com/salvoravida/redux-immer) _is used to create an equivalent function of Redux combineReducers that works with `immer` state. Like `redux-immutable` but for `immer`_- [ngrx-wieder](https://github.com/nilsmehlhorn/ngrx-wieder) _Lightweight yet configurable solution for implementing undo-redo in Angular apps on top of NgRx and Immer_- [ngrx-wieder](https://github.com/nilsmehlhorn/ngrx-wieder) _Lightweight yet configurable solution for implementing undo-redo in Angular apps on top of NgRx and Immer_- ... and [many more](https://www.npmjs.com/browse/depended/immer)modified:docs/complex-objects.md+3 added-1 removed
1 unmodified line2 id: complex-objects3 title: Classes4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 Plain objects (objects without a prototype), arrays, `Map`s and `Set`s are always drafted by Immer. Every other object must use the `immerable` symbol to mark itself as compatible with Immer. When one of these objects is mutated within a producer, its prototype is preserved between copies.11 12 ```js61 unmodified linesmodified:docs/current.md+3 added-1 removed
2 unmodified lines345677891011121345 unmodified lines2 unmodified linestitle: Extracting the current state from a draftsidebar_label: Current---
<div id="codefund"><!-- fallback content --></div><center><div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div></center>
Immer exposes a named export `current` that create a copy of the current state of the draft. This can be very useful for debugging purposes (as those objects won't be Proxy objects and not be logged as such). Also, references to `current` can be safely leaked from a produce function. Put differently, `current` provides a snapshot of the current state of a draft.
Objects generated by `current` work similar to the objects created by produce itself.45 unmodified linesmodified:docs/curried-produce.md+3 added-1 removed
1 unmodified line2 id: curried-produce3 title: Curried producers4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 <details>11 <summary style="color: white; background:#c200c2;padding:5px;margin:5px;border-radius:2px">egghead.io lesson 6: Simplify code by using curried _reduce_</summary>12 <br>59 unmodified linesmodified:docs/example-reducer.md+3 added-1 removed
1 unmodified line2 id: example-reducer3 title: Example Reducer4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 <details>11 <summary style="color: white; background:#c200c2;padding:5px;margin:5px;border-radius:2px">egghead.io lesson 13: Using Immer in a (React) reducer</summary>12 <br>47 unmodified linesmodified:docs/example-setstate.md+3 added-1 removed
1 unmodified line2 id: example-setstate3 title: React setState example4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 <details>11 <summary style="color: white; background:#c200c2;padding:5px;margin:5px;border-radius:2px">egghead.io lesson 8: Using Immer with _useState_. Or: _useImmer_</summary>12 <br>33 unmodified linesmodified:docs/faq.md+3 added-1 removed
2 unmodified lines3 title: Frequently Asked Questions4 sidebar_label: FAQ5 ---6 7-<div id="codefund"><!-- fallback content --></div>7+<center>8+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>9+</center>10 11 ## Q: How does Immer work?12 13 Read the (second part of the) [introduction blog](https://medium.com/@mweststrate/introducing-immer-immutability-the-easy-way-9d73d8f71cb3).32 unmodified linesmodified:docs/freezing.md+3 added-1 removed
1 unmodified line2 id: freezing3 title: Auto freezing4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>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>11 unmodified linesmodified:docs/installation.md+3 added-1 removed
1 unmodified line2 id: installation3 title: Installation4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 Immer can be installed as a direct dependency, and will work in any ES5 environment:11 12 - Yarn: `yarn add immer`66 unmodified linesmodified:docs/introduction.md+3 added-1 removed
2 unmodified lines3 title: Introduction to Immer4 sidebar_label: Introduction5 ---6 7-<div id="codefund"><!-- fallback content --></div>7+<center>8+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>9+</center>10 11 <img src="/immer/img/immer-logo.svg" height="200px" align="right"/>12 13 # Immer53 unmodified linesmodified:docs/map-set.md+3 added-1 removed
1 unmodified line2 id: map-set3 title: Map and Set4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 _⚠ Since version 6 support for `Map`s and `Set`s has to be enabled explicitly by calling [`enableMapSet()`](installation#pick-your-immer-version) once when starting your application._11 12 Plain objects, arrays, `Map`s and `Set`s are always drafted by Immer. An example of using Maps with immer:48 unmodified linesmodified:docs/original.md+3 added-1 removed
2 unmodified lines3 title: Extracting the original state from a draft4 sidebar_label: Original5 ---6 7-<div id="codefund"><!-- fallback content --></div>7+<center>8+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>9+</center>10 11 Immer exposes a named export `original` that will get the original object from the proxied instance inside `produce` (or return `undefined` for unproxied values). A good example of when this can be useful is when searching for nodes in a tree-like state using strict equality.12 13 ```js21 unmodified linesmodified:docs/patches.md+3 added-1 removed
1 unmodified line2 id: patches3 title: Patches4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 <details>11 <summary style="color: white; background:#c200c2;padding:5px;margin:5px;border-radius:2px">egghead.io lesson 14: Capture patches using _produceWithPatches_</summary>12 <br>164 unmodified linesmodified:docs/performance.md+3 added-1 removed
1 unmodified line2 id: performance3 title: Immer performance4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 <details>11 <summary style="color: white; background:#c200c2;padding:5px;margin:5px;border-radius:2px">egghead.io lesson 5: Leveraging Immer's structural sharing in React</summary>12 <br>35 unmodified linesmodified:docs/pitfalls.md+3 added-1 removed
1 unmodified line2 id: pitfalls3 title: Pitfalls4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 1. For performance tips, see [Performance Tips](https://immerjs.github.io/immer/docs/performance/#performance-tips).11 1. Don't redefine draft like, `draft = myCoolNewState`. Instead, either modify the `draft` or return a new state. See [Returning data from producers](https://immerjs.github.io/immer/docs/return).12 1. Immer assumes your state to be a unidirectional tree. That is, no object should appear twice in the tree, and there should be no circular references.22 unmodified linesmodified:docs/produce.md+3 added-1 removed
1 unmodified line2 id: produce3 title: Using produce4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 <details>11 <summary style="color: white; background:#c200c2;padding:5px;margin:5px;border-radius:2px">egghead.io lesson 3: Simplifying deep updates with _produce_</summary>12 <br>51 unmodified linesmodified:docs/resources.md+3 added-1 removed
1 unmodified line2 id: resources3 title: External resources4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 - Blog: [The Rise of Immer in React](https://www.netlify.com/blog/2018/09/12/the-rise-of-immer-in-react/)11 - Blog: by Workday Prism on why they picked Immer to manage immutable state [The Search for a Strongly-Typed, Immutable State](https://medium.com/workday-engineering/workday-prism-analytics-the-search-for-a-strongly-typed-immutable-state-a09f6768b2b5)12 - Blog: [Immutability in React and Redux: The Complete Guide](https://daveceddia.com/react-redux-immutability-guide/)6 unmodified linesmodified:docs/return.md+3 added-1 removed
1 unmodified line2 id: return3 title: Returning new data from producers4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 <details>11 <summary style="color: white; background:#c200c2;padding:5px;margin:5px;border-radius:2px">egghead.io lesson 9: Returning completely new state</summary>12 <br>111 unmodified linesmodified:docs/support.md+3 added-1 removed
1 unmodified line2 id: support3 title: Supporting immer4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 Immer currently has 350.000 dependents on GitHub, and has almost 10.000.000 downloads per month. However, only the first 2 days of development has been sponsored (by Mendix), and all the development and maintenance after that has been a labor of love.11 12 If you are enjoying Immer, and you are grateful for the package, or want to ensure its longevity, consider sponsoring the open collective on https://opencollective.com/immer or make a one time donation using [PayPal](https://www.paypal.me/michelweststrate).modified:docs/typescript.md+3 added-1 removed
2 unmodified lines3 title: Using TypeScript or Flow4 sidebar_label: TypeScript / Flow5 ---6 7-<div id="codefund"><!-- fallback content --></div>7+<center>8+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>9+</center>10 11 <details>12 <summary style="color: white; background:#c200c2;padding:5px;margin:5px;border-radius:2px">egghead.io lesson 12: Immer + TypeScript</summary>13 <br>119 unmodified linesmodified:docs/update-patterns.md+3 added-1 removed
1 unmodified line2 id: update-patterns3 title: Update patterns4 ---5 6-<div id="codefund"><!-- fallback content --></div>6+<center>7+<div data-ea-publisher="immerjs" data-ea-type="image" class="horizontal bordered"></div>8+</center>9 10 Working with immutable data, before Immer, used to mean learning all the immutable update patterns.11 12 To help 'unlearning' those patterns here is an overview how you can leverage the built-in JavaScript APIs to update objects and collections:134 unmodified linesmodified:website/siteConfig.js+1 added-1 removed
70 unmodified lines71 72 // Add custom scripts here that would be placed in <script> tags.73 scripts: [74 "https://buttons.github.io/buttons.js",75- "https://codefund.io/properties/439/funder.js"75+ "https://media.ethicalads.io/media/client/ethicalads.min.js"76 ],77 78 // On page navigation for the current documentation page.79 onPageNav: "separate",23 unmodified lines