-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Describe the bug
If you call fetchNextPage repeatedly, each call will result in the invocation fo the underlying async function, regardless of whether the first invocation has already resolved.
This behavior is inconsistent with that of e.g. refetch. If you call refetch 100 times in a row, before the first invocation has resolved, the underlying async function doesn't get re-invoked.
To Reproduce
Steps to reproduce the behavior:
- Go to this sandbox
- Open the console
- Click on the
Refetchbutton repeatedly. You'll notice the lineFetching...printed on the console, just once (unless you wait more than 5 seconds, which is how long the async call takes to resolve) - Click on the
Fetch Next Pagebutton repeatedly. You'll notice the lineFetching next page...printed on the console several times (once per button click)
Expected behavior
fetchNextPage should behave as refetch: you should see the line Fetching next page... printed only once.
Desktop (please complete the following information):
- OS: macos
- Browser: chrome
- Version: 92