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
feat(query-core): add structuralSharing option to useQueries
Add a `structuralSharing` option to useQueries/createQueries/injectQueries
that allows disabling structural sharing for the combined result. When set
to `false`, the combined result will not use `replaceEqualDeep` for
referential stability. Defaults to `true`.
- Use this to combine the results of the queries into a single value.
27
+
-`structuralSharing?: boolean`
28
+
- Set this to `false` to disable structural sharing between query results when `combine` is provided.
29
+
- Defaults to `true`.
27
30
28
31
> Having the same query key more than once in the array of query objects may cause some data to be shared between queries. To avoid this, consider de-duplicating the queries and map the results back to the desired structure.
29
32
@@ -37,7 +40,7 @@ The `useQueries` hook returns an array with all the query results. The order ret
37
40
38
41
## Combine
39
42
40
-
If you want to combine `data` (or other Query information) from the results into a single value, you can use the `combine` option. The result will be structurally shared to be as referentially stable as possible.
43
+
If you want to combine `data` (or other Query information) from the results into a single value, you can use the `combine` option. The result will be structurally shared to be as referentially stable as possible. If you want to disable structural sharing for the combined result, you can set the `structuralSharing` option to `false`.
0 commit comments