File tree Expand file tree Collapse file tree 2 files changed +1
-13
lines changed Expand file tree Collapse file tree 2 files changed +1
-13
lines changed Original file line number Diff line number Diff line change 11import  {  useState ,  useLayoutEffect ,  useEffect  }  from  'preact/hooks' ; 
2- import  {  is  }  from  './util' ; 
32
43/** 
54 * 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) {
4746	const  prevValue  =  inst . _value ; 
4847	try  { 
4948		const  nextValue  =  latestGetSnapshot ( ) ; 
50- 		return  ! is ( prevValue ,  nextValue ) ; 
49+ 		return  ! Object . is ( prevValue ,  nextValue ) ; 
5150	}  catch  ( error )  { 
5251		return  true ; 
5352	} 
Original file line number Diff line number Diff line change @@ -11,14 +11,3 @@ export function shallowDiffers(a, b) {
1111	for  ( let  i  in  b )  if  ( i  !==  '__source'  &&  a [ i ]  !==  b [ i ] )  return  true ; 
1212	return  false ; 
1313} 
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