You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm incorporating the table state, such as filters and sorting, into the body of a fetch request. Previously, I utilized a custom use hook that invoked an API call whenever path or body changed.
Upon transitioning to useSWR, I now need to pass the body as the second argument to ensure unique data retrieval for different body configurations:
useSWR([subPath, body && JSON.stringify(body)], ...)
However, as highlighted in 363, the revalidation process requires passing the entire array of multiple arguments: mutate(["/api/users", 1]);, which seems somewhat redundant.
Expected Behavior
Mutate data by first key - url/subPath. As: mutate("/api/users");
Repro Steps / Code Example
-
Additional Context
I believe there's no necessity for a full revalidation across all arguments, as most users, like myself, primarily utilize multiple arguments solely for passing the body.
The text was updated successfully, but these errors were encountered:
Bug report
Description / Observed Behavior
I'm incorporating the table state, such as filters and sorting, into the body of a fetch request. Previously, I utilized a custom use hook that invoked an API call whenever path or body changed.
Upon transitioning to useSWR, I now need to pass the body as the second argument to ensure unique data retrieval for different body configurations:
However, as highlighted in 363, the revalidation process requires passing the entire array of multiple arguments: mutate(["/api/users", 1]);, which seems somewhat redundant.
Expected Behavior
Mutate data by first key -
url
/subPath
. As:mutate("/api/users");
Repro Steps / Code Example
-
Additional Context
I believe there's no necessity for a full revalidation across all arguments, as most users, like myself, primarily utilize multiple arguments solely for passing the body.
The text was updated successfully, but these errors were encountered: