(inst: {
_getSnapshot: () => any
_value: any
})
| 48 | } |
| 49 | |
| 50 | function 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 | |
| 65 | export function useSyncExternalStoreWithSelector<TSnapshot, TSelected>( |
| 66 | subscribe: (onStoreChange: () => void) => () => void, |
no outgoing calls
no test coverage detected