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
mutateMany only seems to accept key values which are strings. I use SWR with arrays as the keys (e.g. ['/api/user', token]).
How does mutateMany handle this situation? Do I just call mutateMany with the string '/api/user'? Will this correctly mutate keys in the cache that have the key ['/api/user', token]?
The text was updated successfully, but these errors were encountered:
I ended up using a function to match the key using RegExp, like this: mutateMany(key => RegExp(***regex to match key***).test(key))
This is probably the best way to do this as it stands, although I think it's probably fragile to changes in the way keys are generated in SWR.
A better fix would be to allow string arrays to be used as keys?
Hi there,
mutateMany only seems to accept key values which are strings. I use SWR with arrays as the keys (e.g.
['/api/user', token]
).How does mutateMany handle this situation? Do I just call
mutateMany
with the string'/api/user'
? Will this correctly mutate keys in the cache that have the key['/api/user', token]
?The text was updated successfully, but these errors were encountered: