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
Passing an array to useSWR([key, key], fetcherFn) doesn't seem to cache the keys individually.
Expected Behavior
I should be able to call the keys individually and expect a cached result
Repro Steps / Code Example
functionfetchUsers(...keys){returnPromise.all(keys.map((o)=>fetchUserUtil(o.split('/')[2])));}const{ data }=useSWR(ids.map((v)=>`/users/${id}`),fetchUsers,{dedupingInterval: 1000*60});// Then later when i call the following, a new request is made...const{ data }=useSWR(`/users/1`,fetchUsers,{dedupingInterval: 1000*60});
Additional Context
SWR version: 1.3.0
The text was updated successfully, but these errors were encountered:
ricky-orchid
changed the title
Passing an array of keys doesn't get cached individually
Passing an array of keys doesn't cache the keys individually
Sep 11, 2024
Bug report
Description / Observed Behavior
Passing an array to
useSWR([key, key], fetcherFn)
doesn't seem to cache the keys individually.Expected Behavior
I should be able to call the keys individually and expect a cached result
Repro Steps / Code Example
Additional Context
SWR version:
1.3.0
The text was updated successfully, but these errors were encountered: