MCPcopy Create free account
hub / github.com/effector/effector / shallowCompare

Function shallowCompare

src/react/apiBase.ts:410–428  ·  view source on GitHub ↗
(a: any, b: any)

Source from the content-addressed store, hash-verified

408}
409
410function shallowCompare(a: any, b: any) {
411 if (a === b) return true
412 if (
413 typeof a === 'object' &&
414 a !== null &&
415 typeof b === 'object' &&
416 b !== null
417 ) {
418 const aKeys = Object.keys(a)
419 const bKeys = Object.keys(b)
420 if (aKeys.length !== bKeys.length) return false
421 for (let i = 0; i < aKeys.length; i++) {
422 const key = aKeys[i]
423 if (a[key] !== b[key]) return false
424 }
425 return true
426 }
427 return false
428}

Callers 1

useGateBaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…