MCPcopy Create free account
hub / github.com/TanStack/query / didSnapshotChange

Function didSnapshotChange

packages/preact-query/src/utils.ts:50–63  ·  view source on GitHub ↗
(inst: {
  _getSnapshot: () => any
  _value: any
})

Source from the content-addressed store, hash-verified

48}
49
50function didSnapshotChange(inst: {
51 _getSnapshot: () => any
52 _value: any
53}): boolean {
54 const latestGetSnapshot = inst._getSnapshot
55 const prevValue = inst._value
56 try {
57 const nextValue = latestGetSnapshot()
58 return !Object.is(prevValue, nextValue)
59 // eslint-disable-next-line no-unused-vars
60 } catch (_error) {
61 return true
62 }
63}
64
65export function useSyncExternalStoreWithSelector<TSnapshot, TSelected>(
66 subscribe: (onStoreChange: () => void) => () => void,

Callers 1

useSyncExternalStoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected