can add groups
This commit is contained in:
parent
4b08791bc9
commit
c1ff72025a
8 changed files with 278 additions and 9 deletions
|
|
@ -9,7 +9,7 @@ export {
|
|||
// useDeviceWebsocket,
|
||||
// useFirmwareAPI,
|
||||
// useGitlab,
|
||||
// useGroupAPI,
|
||||
useGroupAPI,
|
||||
useHTTP,
|
||||
// useInteractionsAPI,
|
||||
// useMeasurementsWebsocket,
|
||||
|
|
@ -23,7 +23,7 @@ export {
|
|||
// useUsageAPI,
|
||||
useUserAPI
|
||||
} from "providers";
|
||||
// export * from "./useDebounce";
|
||||
export * from "./useDebounce";
|
||||
// export * from "./useForceUpdate";
|
||||
// export * from "./useInterval";
|
||||
export * from "./usePrevious";
|
||||
|
|
|
|||
13
src/hooks/useDebounce.ts
Normal file
13
src/hooks/useDebounce.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { useState, useEffect } from "react";
|
||||
|
||||
// Debounces value changes until the specificed time in ms has elapsed
|
||||
export const useDebounce = (value: string, ms: number) => {
|
||||
const [debouncedValue, setDebouncedValue] = useState(value);
|
||||
|
||||
useEffect(() => {
|
||||
const handler = setTimeout(() => setDebouncedValue(value), ms);
|
||||
return () => clearTimeout(handler);
|
||||
}, [value, ms]);
|
||||
|
||||
return debouncedValue;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue