Skip to content

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

@marekdedic

Description

@marekdedic

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions