@tanstack/react-query 4.1.3 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/query-core/build/esm/index.js +2 -0
- package/build/cjs/query-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +2 -0
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats.json +180 -180
- package/build/types/packages/query-core/src/types.d.ts +2 -1
- package/build/umd/index.development.js +2 -0
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
package/build/esm/index.js
CHANGED
|
@@ -354,6 +354,8 @@ function replaceData(prevData, data, options) {
|
|
|
354
354
|
// Use prev data if an isDataEqual function is defined and returns `true`
|
|
355
355
|
if (options.isDataEqual != null && options.isDataEqual(prevData, data)) {
|
|
356
356
|
return prevData;
|
|
357
|
+
} else if (typeof options.structuralSharing === 'function') {
|
|
358
|
+
return options.structuralSharing(prevData, data);
|
|
357
359
|
} else if (options.structuralSharing !== false) {
|
|
358
360
|
// Structurally share data between prev and new data if needed
|
|
359
361
|
return replaceEqualDeep(prevData, data);
|