Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependent fetching doesn't revalidate when changing to an already cached value #43

Open
marekdedic opened this issue Mar 13, 2023 · 0 comments

Comments

@marekdedic
Copy link
Contributor

Hi, I'm using dependent fetching and after #33 it works for me - sort of.

I have a SWR table with a filtering function - user enters a value into the field and with dependent fetching, the value is used as part of a request. While the request is in-flight a show a spinning loading indicator.

Initially, this works great:

  1. User enters/changes a value
  2. The SWR changes to undefined, I show the loading indicator
  3. A request is triggered
  4. When the request resolves, the SWR changes from undefined to the actual value and the table is shown.

However, when the user enters a value that he has already previously entered (so the request response is in SWR's cache), the following happens:

  1. User enters/changes a value
  2. The SWR changes to undefined, I show the loading indicator
  3. Nothing more - no request is fired (I use a long dedupingInterval), no value is returned.

I think this might actually be an issue with swrev?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant