Skip to content

Commit

Permalink
test new approach
Browse files Browse the repository at this point in the history
  • Loading branch information
k-rajat19 committed Oct 19, 2024
1 parent 0d0201a commit a3dec2d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/x-data-grid/src/utils/createSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,15 @@ export const createSelector = ((
}) as unknown as CreateSelectorFunction;

export const createSelectorMemoized: CreateSelectorFunction = (...args: any) => {
const selector = (stateOrApiRef: any, selectorArgs: any, instanceId?: any) => {
const selector = (...Args: any[]) => {
const [stateOrApiRef, ...other] = Args;
let instanceId: any;
let selectorArgs: any;
if (typeof other === 'object' && 'id' in other && typeof other.id === 'number') {
instanceId = other;
} else {
selectorArgs = other;
}
const isAPIRef = checkIsAPIRef(stateOrApiRef);
const cacheKey = isAPIRef
? stateOrApiRef.current.instanceId
Expand Down

0 comments on commit a3dec2d

Please sign in to comment.