Skip to content

Commit

Permalink
Merge pull request #443 from Mudassar045/fix-grammatical-typos
Browse files Browse the repository at this point in the history
fix grammatical errors and typos
  • Loading branch information
mweststrate committed Oct 15, 2019
2 parents 0a57561 + 21e76c2 commit 0349152
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions __tests__/readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe("readme example", () => {
}

const nextState = produce(state, draft => {
draft.title = draft.title.toUpperCase() // let immer do it's job
draft.title = draft.title.toUpperCase() // let immer do its job
// don't use the operations onSet, as that mutates the instance!
// draft.tokenSet.add("c1342")

Expand All @@ -120,7 +120,7 @@ describe("readme example", () => {
const nextState = produce(state, draft => {
const newUsers = new Map(draft.users)
// mutate the new map and set a _new_ user object
// but leverage produce again to deeply update it's contents
// but leverage produce again to deeply update its contents
newUsers.set(
"michel",
produce(draft.users.get("michel"), draft => {
Expand Down
2 changes: 1 addition & 1 deletion _site/readme/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ <h2>Performance</h2>
upfront cost of converting data received from e.g. the server to immutable
JS)
</li>
<li>Generating patches doesn't significantly slow immer down</li>
<li>Generating patches doesn't significantly slow down immer</li>
<li>
The ES5 fallback implementation is roughly twice as slow as the proxy
implementation, in some cases worse.
Expand Down
4 changes: 2 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title: API overview
| `createDraft` | Given a base state, creates a mutable draft for which any modifications will be recorded | [Async](async.md) |
| `Draft<T>` | Exposed TypeScript type to convert an immutable type to a mutable type | [TypeScript](typescript.md) |
| `finishDraft` | Given an draft created using `createDraft`, seals the draft and produces and returns the next immutable state that captures all the changes | [Async](async.md) |
| `Immer` | constructor that can be used to create a second "immer" instance (exposing all APIs listed in this instance), that doesn't share it's settings with global instance. Can also be used to attach further hooks that are triggered during object finalization, such as `onAssign`, `onDelete` and `onCopy`. | [See source](https://github.com/immerjs/immer/blob/cb1c6dd8a33073aaa0a4d881c94ec7ab1c1be7f6/src/immer.d.ts#L224-L233) |
| `Immer` | constructor that can be used to create a second "immer" instance (exposing all APIs listed in this instance), that doesn't share its settings with global instance. Can also be used to attach further hooks that are triggered during object finalization, such as `onAssign`, `onDelete` and `onCopy`. | [See source](https://github.com/immerjs/immer/blob/cb1c6dd8a33073aaa0a4d881c94ec7ab1c1be7f6/src/immer.d.ts#L224-L233) |
| `immerable` | Symbol that can be added to a constructor or prototype, to indicate that Immer should treat the class as something that can be safely drafted | [Classes](complex-objects.md) |
| `Immutable<T>` | Exposed TypeScript type to convert mutable types to immutable types | |
| `isDraft` | Returns true if the given object is a draft object | |
Expand All @@ -20,7 +20,7 @@ title: API overview
| `original` | Given a draft object (doesn't have to be a tree root), returns the the original object at the same path in the original state tree, if present | [Original](original.md) |
| `Patch` | Exposed TypeScript type, describes the shape of an (inverse) patch object | [Patches](patches.md) |
| `produce` | The core API of Immer, also exposed as the `default` export | [Produce](produce.md) |
| `setAutoFreeze` | Enables / disableds automatic freezing of the trees produces. By default enabled in development builds | [Freezing](freezing.md) |
| `setAutoFreeze` | Enables / disables automatic freezing of the trees produces. By default enabled in development builds | [Freezing](freezing.md) |
| `setUseProxies` | Can be used to disable or force the use of `Proxy` objects. Useful when filing bug reports. | |

## Importing immer
Expand Down
2 changes: 1 addition & 1 deletion docs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Most important observation:

- Immer with proxies is roughly speaking twice to three times slower as a handwritten reducer (the above test case is worst case, see `yarn test:perf` for more tests). This is in practice negligible.
- Immer is roughly as fast as ImmutableJS. However, the _immutableJS + toJS_ makes clear the cost that often needs to be paid later; converting the immutableJS objects back to plain objects, to be able to pass them to components, over the network etc... (And there is also the upfront cost of converting data received from e.g. the server to immutable JS)
- Generating patches doesn't significantly slow immer down
- Generating patches doesn't significantly slow down immer
- The ES5 fallback implementation is roughly twice as slow as the proxy implementation, in some cases worse.
2 changes: 1 addition & 1 deletion docs/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ title: Supporting immer

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.

If you are enjoying Immer, and you are grateful for the package, or want to ensure it's longevity, consider sponsoring the open collective on https://opencollective.com/immer or make a one time donation using [PayPal](https://www.paypal.me/michelweststrate).
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).

0 comments on commit 0349152

Please sign in to comment.