This repository has been archived by the owner on Feb 6, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race condition when fetching more items after page is focused
`fetchMore()` and `refetch()` were triggered at the same time, which resulted in new items being merged with out-dated items, if `setData()` was called to manually update the `data` object. This commit fixes it by replacing `useReducer()` with `useState()` + callbacks, which ensures all state updates are queued and state is changed sequentially, based on the last value.
- Loading branch information
Vadim Demedes
committed
Apr 4, 2020
1 parent
5c4551a
commit 0e3ec3b
Showing
1 changed file
with
64 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0e3ec3b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: