2
0

refactor: ♻️ Migrate to dequal

This commit is contained in:
Baptiste Arnaud
2022-03-10 18:17:51 +01:00
parent d134a265cd
commit 5c524a0432
9 changed files with 22 additions and 23 deletions

View File

@ -1,5 +1,5 @@
import { isDefined } from '@udecode/plate-core'
import { deepEqual } from 'fast-equals'
import { dequal } from 'dequal'
// import { diff } from 'deep-object-diff'
import { useReducer, useCallback, useRef } from 'react'
import { isNotDefined } from 'utils'
@ -76,7 +76,7 @@ const reducer = <T>(state: State<T>, action: Action<T>) => {
if (
isNotDefined(newPresent) ||
(present &&
deepEqual(
dequal(
JSON.parse(JSON.stringify(newPresent)),
JSON.parse(JSON.stringify(present))
))