Skip to content

Commit

Permalink
removed duplicated debounce lib
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsingal committed Oct 17, 2023
1 parent 01d32a2 commit a0624b6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 26 deletions.
1 change: 0 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@json2csv/plainjs": "^6.1.3",
"@loaders.gl/core": "3.3.1",
"@luma.gl/constants": "8.5.18",
"@react-hook/debounce": "4.0.0",
"@reduxjs/toolkit": "1.8.2",
"@tailwindcss/forms": "0.4.0",
"@tailwindcss/typography": "0.5.0",
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/search/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useCallback, useEffect, useState } from 'react';
import { SearchIcon, XIcon } from '@heroicons/react/solid';
import classnames from 'classnames';
import { omit } from 'lodash-es';
import { useDebounceCallback } from '@react-hook/debounce';
import { useDebounce } from 'rooks';
import { useRouter } from 'next/router';

import type { ChangeEvent } from 'react';
Expand All @@ -24,7 +24,7 @@ export const Search: React.FC<SearchProps> = ({

const [value, setValue] = useState<string>(initialValue);

const handleSearchByTerm = useDebounceCallback((value, queryName) => {
const handleSearchByTerm = useDebounce((value, queryName) => {
replace(
{
pathname,
Expand Down
4 changes: 2 additions & 2 deletions client/src/containers/scenarios/filters/component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useMemo } from 'react';
import { useDispatch } from 'react-redux';
import { useDebounceCallback } from '@react-hook/debounce';
import { useDebounce } from 'rooks';
import { SortDescendingIcon } from '@heroicons/react/solid';

import { useAppSelector } from 'store/hooks';
Expand All @@ -26,7 +26,7 @@ const ScenariosFilters: FC = () => {
const { searchTerm, sort } = useAppSelector(scenarios);

const handleSort = useCallback((selected) => dispatch(setSort(selected.value)), [dispatch]);
const handleSearchByTerm = useDebounceCallback((value) => dispatch(setSearchTerm(value)), 250);
const handleSearchByTerm = useDebounce((value) => dispatch(setSearchTerm(value)), 250);

const currentSort = useMemo(() => SORT_OPTIONS.find(({ value }) => value === sort), [sort]);

Expand Down
21 changes: 0 additions & 21 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1346,26 +1346,6 @@ __metadata:
languageName: node
linkType: hard

"@react-hook/debounce@npm:4.0.0":
version: 4.0.0
resolution: "@react-hook/debounce@npm:4.0.0"
dependencies:
"@react-hook/latest": ^1.0.2
peerDependencies:
react: ">=16.8"
checksum: 199f944fd905b6cbeb0665e94ce49805f6a0a6f758f35862d784b87dd5c52760dcf2ce9a66abc5698f5b1418be387df5452a703812e9362d1dda0f9718a5d01d
languageName: node
linkType: hard

"@react-hook/latest@npm:^1.0.2":
version: 1.0.3
resolution: "@react-hook/latest@npm:1.0.3"
peerDependencies:
react: ">=16.8"
checksum: 2408c9cd35c5cfa7697b6da3bc5eebef254a932ade70955074c474f23be7dd3e2f81bbba12edcc9208bd0f89c6ed366d6b11d4f6d7b1052877a0bac8f74afad4
languageName: node
linkType: hard

"@reduxjs/toolkit@npm:1.8.2":
version: 1.8.2
resolution: "@reduxjs/toolkit@npm:1.8.2"
Expand Down Expand Up @@ -6297,7 +6277,6 @@ __metadata:
"@json2csv/plainjs": ^6.1.3
"@loaders.gl/core": 3.3.1
"@luma.gl/constants": 8.5.18
"@react-hook/debounce": 4.0.0
"@reduxjs/toolkit": 1.8.2
"@tailwindcss/forms": 0.4.0
"@tailwindcss/typography": 0.5.0
Expand Down

0 comments on commit a0624b6

Please sign in to comment.