diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-11-15 17:15:20 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-15 17:26:17 +0100 |
| commit | 26a1e3a7a08e4b0fdb4dfcc3ed6a6cc21bcef104 (patch) | |
| tree | 68d0ddf7cdc1e83f3f56607f6c4fee1f0bbd9820 /src/utils/hooks/use-state-change.tsx | |
| parent | 36baf3e5725aeae00d81d3a082b3c04074e09f8e (diff) | |
refactor(hooks): remove unused hooks
* useMutationObserver removed
* useStateChange removed
Diffstat (limited to 'src/utils/hooks/use-state-change.tsx')
| -rw-r--r-- | src/utils/hooks/use-state-change.tsx | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/utils/hooks/use-state-change.tsx b/src/utils/hooks/use-state-change.tsx deleted file mode 100644 index 59ae0df..0000000 --- a/src/utils/hooks/use-state-change.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { useEffect, useState } from 'react'; - -/** - * Use React useState hook and update it if initial data change. - * - * @param initial - The initial value. - * @returns The state and a setter. - */ -export const useStateChange = <T,>(initial: T) => { - const [state, setState] = useState<T>(initial); - - useEffect(() => { - setState(initial); - }, [initial]); - - return [state, setState] as const; -}; |
