Skip to content

Commit d129739

Browse files
authored
Fix statement on Checking Async Thunk Conditions (#4767)
1 parent f25ed51 commit d129739

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/tutorials/essentials/part-5-async-logic.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ The last option would be to use the actual `state.posts.status` value from the R
603603

604604
`createAsyncThunk` accepts an optional `condition` callback we can use to do that check. If provided, it runs at the start of the thunk call, and it will cancel the entire thunk if `condition` returns `false.`
605605

606-
In this case, we know that we want to avoid running the thunk if the `state.posts.status` field is `'idle'`. We already have a `selectPostsStatus` selector that we can use here, so we can add the `condition` option and check that value:
606+
In this case, we know that we want to avoid running the thunk if the `state.posts.status` field is not `'idle'`. We already have a `selectPostsStatus` selector that we can use here, so we can add the `condition` option and check that value:
607607

608608
```ts title="features/posts/postsSlice.ts
609609
export const fetchPosts = createAppAsyncThunk(

0 commit comments

Comments
 (0)