@tanstack/query-core
Advanced tools
Comparing version
@@ -147,15 +147,9 @@ import { | ||
trackResult(result, onPropTracked) { | ||
const trackedResult = {}; | ||
Object.keys(result).forEach((key) => { | ||
Object.defineProperty(trackedResult, key, { | ||
configurable: false, | ||
enumerable: true, | ||
get: () => { | ||
this.trackProp(key); | ||
onPropTracked == null ? void 0 : onPropTracked(key); | ||
return result[key]; | ||
} | ||
}); | ||
return new Proxy(result, { | ||
get: (target, key) => { | ||
this.trackProp(key); | ||
onPropTracked == null ? void 0 : onPropTracked(key); | ||
return Reflect.get(target, key); | ||
} | ||
}); | ||
return trackedResult; | ||
} | ||
@@ -162,0 +156,0 @@ trackProp(key) { |
@@ -138,15 +138,9 @@ // src/queryObserver.ts | ||
trackResult(result, onPropTracked) { | ||
const trackedResult = {}; | ||
Object.keys(result).forEach((key) => { | ||
Object.defineProperty(trackedResult, key, { | ||
configurable: false, | ||
enumerable: true, | ||
get: () => { | ||
this.trackProp(key); | ||
onPropTracked?.(key); | ||
return result[key]; | ||
} | ||
}); | ||
return new Proxy(result, { | ||
get: (target, key) => { | ||
this.trackProp(key); | ||
onPropTracked?.(key); | ||
return Reflect.get(target, key); | ||
} | ||
}); | ||
return trackedResult; | ||
} | ||
@@ -153,0 +147,0 @@ trackProp(key) { |
{ | ||
"name": "@tanstack/query-core", | ||
"version": "5.74.7", | ||
"version": "5.74.9", | ||
"description": "The framework agnostic core that powers TanStack Query", | ||
@@ -5,0 +5,0 @@ "author": "tannerlinsley", |
@@ -271,17 +271,9 @@ import { focusManager } from './focusManager' | ||
): QueryObserverResult<TData, TError> { | ||
const trackedResult = {} as QueryObserverResult<TData, TError> | ||
Object.keys(result).forEach((key) => { | ||
Object.defineProperty(trackedResult, key, { | ||
configurable: false, | ||
enumerable: true, | ||
get: () => { | ||
this.trackProp(key as keyof QueryObserverResult) | ||
onPropTracked?.(key as keyof QueryObserverResult) | ||
return result[key as keyof QueryObserverResult] | ||
}, | ||
}) | ||
return new Proxy(result, { | ||
get: (target, key) => { | ||
this.trackProp(key as keyof QueryObserverResult) | ||
onPropTracked?.(key as keyof QueryObserverResult) | ||
return Reflect.get(target, key) | ||
}, | ||
}) | ||
return trackedResult | ||
} | ||
@@ -288,0 +280,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1981595
-0.12%22637
-0.13%