File tree 2 files changed +1
-13
lines changed
2 files changed +1
-13
lines changed Original file line number Diff line number Diff line change 1
1
import { useState , useLayoutEffect , useEffect } from 'preact/hooks' ;
2
- import { is } from './util' ;
3
2
4
3
/**
5
4
* This is taken from https://github.com/facebook/react/blob/main/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L84
@@ -47,7 +46,7 @@ function didSnapshotChange(inst) {
47
46
const prevValue = inst . _value ;
48
47
try {
49
48
const nextValue = latestGetSnapshot ( ) ;
50
- return ! is ( prevValue , nextValue ) ;
49
+ return ! Object . is ( prevValue , nextValue ) ;
51
50
} catch ( error ) {
52
51
return true ;
53
52
}
Original file line number Diff line number Diff line change @@ -11,14 +11,3 @@ export function shallowDiffers(a, b) {
11
11
for ( let i in b ) if ( i !== '__source' && a [ i ] !== b [ i ] ) return true ;
12
12
return false ;
13
13
}
14
-
15
- /**
16
- * Check if two values are the same value
17
- * @param {* } x
18
- * @param {* } y
19
- * @returns {boolean }
20
- */
21
- export function is ( x , y ) {
22
- // TODO: can we replace this with Object.is?
23
- return ( x === y && ( x !== 0 || 1 / x === 1 / y ) ) || ( x !== x && y !== y ) ;
24
- }
You can’t perform that action at this time.
0 commit comments