Skip to content

Commit

Permalink
feat: add jsdoc for useOnClickOutside
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Sep 13, 2023
1 parent 06a54c9 commit 9b83c41
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/utils/useOnClickOutside/useOnClickOutside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ export type UseOnClickOutsideType = <T extends HTMLElement>({
handleCallback?: () => void;
}) => void;

/**
* Hook for observing clicks outside a given target
*
* @param observedRef - purpose of observation
* @param enabled - enabled/disable flag
* @param handleCallback - callback when a click is triggered outside the observation target
*
* @return - nothing
*/
export const useOnClickOutside: UseOnClickOutsideType = ({
observedRef,
enabled = true,
Expand Down

0 comments on commit 9b83c41

Please sign in to comment.