Skip to content

Commit e5c26db

Browse files
msutkowskimarkerikson
authored andcommitted
Apply suggestions from code review
Co-Authored-By: Mark Erikson <[email protected]>
1 parent 53bc960 commit e5c26db

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/api/createAsyncThunk.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ const UsersComponent = () => {
453453
```
454454
455455
- TypeScript: Using rejectWithValue to access a custom rejected payload in a component
456-
_Note: this is a contrived example assuming our userAPI only ever throws a validation-specific errors_
456+
_Note: this is a contrived example assuming our userAPI only ever throws validation-specific errors_
457457
458458
```typescript
459459
import { createAsyncThunk, createSlice, unwrapResult } from '@reduxjs/toolkit'
@@ -527,7 +527,7 @@ const usersSlice = createSlice({
527527
})
528528

529529
const UsersComponent = () => {
530-
const { users, loading, error } = useSelector(state => state.users)
530+
const { users, loading, error } = useSelector( (state: RootState) => state.users)
531531
const dispatch = useDispatch()
532532

533533
const updateUser = async userData => {

docs/usage/usage-with-typescript.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ const usersSlice = createSlice({
504504
})
505505
builder.addCase(updateUserById.rejected, (state, action) => {
506506
if (action.payload) {
507-
// Being that we passed in MyKnownError to rejectType in `updateUserById`, the type information will be available here.
507+
// Since we passed in `MyKnownError` to `rejectType` in `updateUserById`, the type information will be available here.
508508
state.error = action.payload.errorMessage
509509
} else {
510510
state.error = action.error
@@ -525,7 +525,7 @@ const updateUser = async userData => {
525525
showToast('success', `Updated ${user.name}`)
526526
} else {
527527
if (resultAction.payload) {
528-
// Being that we passed in MyKnownError to rejectType in `updateUserById`, the type information will be available here.
528+
// Since we passed in `MyKnownError` to `rejectType` in `updateUserById`, the type information will be available here.
529529
showToast('error', `Update failed: ${rersultAction.payload.errorMessage}`)
530530
} else {
531531
showToast('error', `Update failed: ${resultAction.error.message}`)

0 commit comments

Comments
 (0)