refactor: ♻️ Migrate to dequal
This commit is contained in:
@@ -36,7 +36,7 @@ import { HeadersInputs, QueryParamsInputs } from './KeyValueInputs'
|
||||
import { VariableForTestInputs } from './VariableForTestInputs'
|
||||
import { DataVariableInputs } from './ResponseMappingInputs'
|
||||
import { byId } from 'utils'
|
||||
import { deepEqual } from 'fast-equals'
|
||||
import { dequal } from 'dequal'
|
||||
import { SwitchWithLabel } from 'components/shared/SwitchWithLabel'
|
||||
|
||||
type Props = {
|
||||
@@ -63,7 +63,7 @@ export const WebhookSettings = ({
|
||||
|
||||
useEffect(() => {
|
||||
const incomingWebhook = webhooks.find(byId(webhookId))
|
||||
if (deepEqual(incomingWebhook, localWebhook)) return
|
||||
if (dequal(incomingWebhook, localWebhook)) return
|
||||
setLocalWebhook(incomingWebhook)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [webhooks])
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Box, Button, Fade, Flex, IconButton, Stack } from '@chakra-ui/react'
|
||||
import { TrashIcon, PlusIcon } from 'assets/icons'
|
||||
import { deepEqual } from 'fast-equals'
|
||||
import { dequal } from 'dequal'
|
||||
import { Draft } from 'immer'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { generate } from 'short-uuid'
|
||||
@@ -35,7 +35,7 @@ export const TableList = <T,>({
|
||||
const [showDeleteIndex, setShowDeleteIndex] = useState<number | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (deepEqual(items, initialItems)) return
|
||||
if (dequal(items, initialItems)) return
|
||||
onItemsChange(items)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [items])
|
||||
|
||||
Reference in New Issue
Block a user