We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cd2fef commit 1d0d4ffCopy full SHA for 1d0d4ff
README.md
@@ -429,7 +429,7 @@ Keep in mind these are completely optional. To use but showcase the power of our
429
To prevent duplicate fetching and to trigger handle refetching we provide a cache api. That takes a function and returns the same function.
430
431
```jsx
432
-const getUser = cache((id) => {
+const getUser = cache(async (id) => {
433
return (await fetch(`/api/users${id}`)).json()
434
}, "users") // used as cache key + serialized arguments
435
```
0 commit comments