Closed goce-cz closed 3 years ago
Resolves #14
As agreed by everyone, we're changing the default equality function of usePartialSnapshot from isShallowEqual to Object.is
usePartialSnapshot
isShallowEqual
Object.is
You can blindly change every usage of
usePartialSnapshot(observable, selector, [...deps])
into
import { isShallowEqual } from '@spicy-hooks/utils' ... usePartialSnapshot(observable, selector, isShallowEqual, [...deps])
BUT, please think first whether you really need shallow comparison instead of the default (and much faster) Object.is.
Resolves #14
As agreed by everyone, we're changing the default equality function of
usePartialSnapshot
fromisShallowEqual
toObject.is
Migration
You can blindly change every usage of
into
BUT, please think first whether you really need shallow comparison instead of the default (and much faster)
Object.is
.