Skip to content

Commit 7874b01

Browse files
committed
docs(part-5): fix thunk logic grammatical error
Remove redundant wording "adding" to resolve a tautology. The original sentence phrasing "adding resulting in" was grammatically incorrect. This update clarifies the logic flow where concurrent thunks trigger duplicate state updates, ensuring a smoother reading experience for developers learning async logic in Part 5.
1 parent 09c99bd commit 7874b01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ In this case, what happened is:
589589
- The `useEffect` hook ran for the first time. The `postStatus` value is `'idle'`, so it dispatches the `fetchPosts` thunk.
590590
- `fetchPosts` immediately dispatches its `fetchPosts.pending` action, so the Redux store _did_ update the status to `'pending'` right away...
591591
- **but React runs the `useEffect` _again_ without re-rendering the component, so the effect still thinks that `postStatus` is `'idle'` and dispatches `fetchPosts` a second time**
592-
- Both thunks finish fetching their data, dispatch the `fetchPosts.fulfilled` action, and the `fulfilled` reducer runs twice, adding resulting in a duplicate set of posts being added to the state
592+
- Both thunks finish fetching their data and dispatch the `fetchPosts.fulfilled` action; consequently, the `fulfilled` reducer runs twice, resulting in a duplicate set of posts being added to the state
593593

594594
So, how can we fix this?
595595

0 commit comments

Comments
 (0)