diff --git a/README.md b/README.md index d6c3e5d..ff8a142 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@ yarn add react-state-selector > Check **https://pabloszx.github.io/react-state-selector** for more detailed examples and use cases. -### TODOs +### Features -- [x] Redux DevTools -- [x] async actions +- [x] Redux **DevTools** support +- [x] **async** actions (_**redux-thunk** alike_) - [x] **TypeScript** first class support - [x] **_reselect_** createSelector support -- [ ] **More** examples and use cases (In progress...) +- [x] Easy and efficient **localStorage** data persistence ### Basic Usage @@ -57,12 +57,12 @@ const { }, }, actions: { - incrementA: (n: number) => draft => { + incrementA: (n: number) => (draft) => { // Here you can mutate "draft", and immer will // automatically make the immutable equivalent draft.countA += n; }, - incrementB: (n: number) => draft => { + incrementB: (n: number) => (draft) => { draft.countB += n; }, }, @@ -126,12 +126,12 @@ const { }, }, actions: { - incrementA: (n: number) => draft => { + incrementA: (n: number) => (draft) => { // Here you can mutate "draft", and immer will // automatically make the immutable equivalent draft.countA += n; }, - incrementB: (n: number) => draft => { + incrementB: (n: number) => (draft) => { draft.countB += n; }, }, @@ -195,7 +195,7 @@ By default every created store gives a couple of out of the box functionality, i - If you **don't** give it a function, it will work simply as a **state getter**, so you can check the global state anytime without any restriction. ```ts -const state = produce(draft => { +const state = produce((draft) => { draft.a += 1; }); console.log(produce() === state); // true @@ -208,7 +208,7 @@ console.log(produce() === state); // true - You shouldn't rely on this feature to transform the entire state as with [produce](#produce-functiondraft--void--tstore-tstore) or [custom actions](#custom-actions); ```ts -const state = await asyncProduce(async draft => { +const state = await asyncProduce(async (draft) => { draft.users = await (await fetch("/api/users")).json(); }); console.log(produce() === state); // true @@ -251,7 +251,7 @@ const IncrementComp = () => { return (