From 26a1e3a7a08e4b0fdb4dfcc3ed6a6cc21bcef104 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Wed, 15 Nov 2023 17:15:20 +0100
Subject: refactor(hooks): remove unused hooks

* useMutationObserver removed
* useStateChange removed
---
 src/utils/hooks/use-mutation-observer.tsx | 28 ----------------------------
 1 file changed, 28 deletions(-)
 delete mode 100644 src/utils/hooks/use-mutation-observer.tsx

(limited to 'src/utils/hooks/use-mutation-observer.tsx')

diff --git a/src/utils/hooks/use-mutation-observer.tsx b/src/utils/hooks/use-mutation-observer.tsx
deleted file mode 100644
index c56f7aa..0000000
--- a/src/utils/hooks/use-mutation-observer.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { useEffect } from 'react';
-
-type UseMutationObserverProps = {
-  callback: () => void;
-  options: MutationObserverInit;
-  nodeOrSelector: string | HTMLElement;
-};
-
-export const useMutationObserver = ({
-  callback,
-  options,
-  nodeOrSelector,
-}: UseMutationObserverProps) => {
-  useEffect(() => {
-    const targetNode =
-      typeof nodeOrSelector === 'string'
-        ? document.querySelector(nodeOrSelector)!
-        : nodeOrSelector;
-
-    const observer = new MutationObserver(callback);
-
-    observer.observe(targetNode, options);
-
-    return () => {
-      observer.disconnect();
-    };
-  }, [nodeOrSelector, options, callback]);
-};
-- 
cgit v1.2.3

