Skip to content

Commit 641bdb8

Browse files
Dmitry Rogmarkerikson
authored andcommitted
Typo fix in docs code sample (#112)
* Typo fix in docs code sample * Code sample typo fix * Code sample typo ifx * Code sample typo fix
1 parent 6ef3690 commit 641bdb8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/usage/usage-guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ const todosReducer = createReducer([], {
196196
// Can still return an immutably-updated value if we want to
197197
return state.filter( (todo, i) => i !== action.payload.index)
198198
}
199-
}
199+
})
200200
```
201201

202202
The ability to "mutate" the state is especially helpful when trying to update deeply nested state. This complex and painful code:
@@ -462,7 +462,7 @@ console.log(postsSlice)
462462
}
463463
*/
464464

465-
const { createPost } = slice.actions
465+
const { createPost } = postsSlice.actions
466466

467467
console.log(createPost({ id: 123, title: 'Hello World' }))
468468
// {type : "createPost", payload : {id : 123, title : "Hello World"}}
@@ -483,7 +483,7 @@ const postsSlice = createSlice({
483483
}
484484
})
485485

486-
const { createPost } = slice.actions
486+
const { createPost } = postsSlice.actions
487487

488488
console.log(createPost({ id: 123, title: 'Hello World' }))
489489
// {type : "posts/createPost", payload : {id : 123, title : "Hello World"}}
@@ -505,7 +505,7 @@ const postsSlice = createSlice({
505505
})
506506

507507
// Extract the action creators object and the reducer
508-
const { actions, reducer } = slice
508+
const { actions, reducer } = postsSlice
509509
// Extract and export each action creator by name
510510
export const { createPost, updatePost, deletePost } = actions
511511
// Export the reducer, either as a default or named export

0 commit comments

Comments
 (0)