From 65f82ce94f8d2be82d08c296419de7c370eef67e Mon Sep 17 00:00:00 2001 From: Homyee King Date: Tue, 20 Jul 2021 05:22:21 +0800 Subject: [PATCH] chore(shared): remove extra NaN logic (#3837) --- packages/shared/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 84b324be..3c000005 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -143,7 +143,7 @@ export const toHandlerKey = cacheStringFunction( // compare whether a value has changed, accounting for NaN. export const hasChanged = (value: any, oldValue: any): boolean => - value !== oldValue && (value === value || oldValue === oldValue) + !Object.is(value, oldValue) export const invokeArrayFns = (fns: Function[], arg?: any) => { for (let i = 0; i < fns.length; i++) {