({
state,
action,
}: UseHideMobileSidebarProps)
| 6 | action: () => unknown; |
| 7 | } |
| 8 | export default function useHideMobileSidebar({ |
| 9 | state, |
| 10 | action, |
| 11 | }: UseHideMobileSidebarProps): void { |
| 12 | const router = useRouter(); |
| 13 | |
| 14 | // eslint-disable-next-line eslint-compat/consistent-return |
| 15 | useEffect(() => { |
| 16 | if (state) { |
| 17 | router?.events?.on('routeChangeStart', action); |
| 18 | |
| 19 | return () => { |
| 20 | router?.events?.off('routeChangeStart', action); |
| 21 | }; |
| 22 | } |
| 23 | // @NOTE see https://dailydotdev.atlassian.net/l/cp/dK9h1zoM |
| 24 | // eslint-disable-next-line react-hooks/exhaustive-deps |
| 25 | }, [state]); |
| 26 | } |
nothing calls this directly
no test coverage detected