export const isEqual = ( x , y ) => { if ( x === y ) { return x !== 0 || y !== 0 || 1 / x === 1 / y ; } return x !== x && y !== y ; } ; export function areShallowEqualWithArray ( prev , next ) { if ( prev === null || next === null || prev . length !== next . length ) { return false ; } const { length } = prev ; for ( let i = 0 ; i < length ; i += 1 ) { if ( ! isEqual ( prev [ i ] , next [ i ] ) ) { return false ; } } return true ; }