Replies: 2 comments
-
As a workaround, you can use implode? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Whilst I can appreciate the need for this where the cache index id is a combination of several different items, I am not sure that the relatively simple example provided does justice to this need. I would therefore propose:
instead of:
or:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
TanStack Query allows you to pass an array of stringable items as the key for a cache.
It's a minor thing, but it feels nicer than concatenating multiple items. In Laravel, it could look like this:
...which would be equivalent to this:
Cache keys are for computers, not humans, and this takes away some of the (admittedly minor) pressure of naming them.
Beta Was this translation helpful? Give feedback.
All reactions