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
Copy file name to clipboardExpand all lines: packages/core/useMemoize/index.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,12 @@ await getUser.load(1) // Will also update user1
53
53
The key for caching is determined by the arguments given to the function and will be serialized by default with `JSON.stringify`.
54
54
This will allow equal objects to receive the same cache key. In case you want to customize the key you can pass `getKey`
55
55
56
+
::: warning Performance Consideration
57
+
Using `JSON.stringify` as the default key generator can be **slow for large or complex objects**. For better performance with complex arguments, it's highly recommended to provide a custom `getKey` function that generates keys based on primitive values or unique identifiers.
0 commit comments