forked from juliencrn/usehooks-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: named export and md without frontmatter
- Loading branch information
Showing
104 changed files
with
76 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,37 @@ | ||
export { default as useBoolean } from './useBoolean/useBoolean' | ||
export * from './useBoolean/useBoolean' | ||
export { default as useClickAnyWhere } from './useClickAnyWhere/useClickAnyWhere' | ||
export * from './useClickAnyWhere/useClickAnyWhere' | ||
export { default as useCopyToClipboard } from './useCopyToClipboard/useCopyToClipboard' | ||
export * from './useCopyToClipboard/useCopyToClipboard' | ||
export { default as useCountdown } from './useCountdown/useCountdown' | ||
export * from './useCountdown/useCountdown' | ||
export { default as useCounter } from './useCounter/useCounter' | ||
export * from './useCounter/useCounter' | ||
export { default as useDarkMode } from './useDarkMode/useDarkMode' | ||
export * from './useDarkMode/useDarkMode' | ||
export { default as useDebounce } from './useDebounce/useDebounce' | ||
export * from './useDebounce/useDebounce' | ||
export { default as useDocumentTitle } from './useDocumentTitle/useDocumentTitle' | ||
export * from './useDocumentTitle/useDocumentTitle' | ||
export { default as useEffectOnce } from './useEffectOnce/useEffectOnce' | ||
export * from './useEffectOnce/useEffectOnce' | ||
export { default as useElementSize } from './useElementSize/useElementSize' | ||
export * from './useElementSize/useElementSize' | ||
export { default as useEventCallback } from './useEventCallback/useEventCallback' | ||
export * from './useEventCallback/useEventCallback' | ||
export { default as useEventListener } from './useEventListener/useEventListener' | ||
export * from './useEventListener/useEventListener' | ||
export { default as useFetch } from './useFetch/useFetch' | ||
export * from './useFetch/useFetch' | ||
export { default as useHover } from './useHover/useHover' | ||
export * from './useHover/useHover' | ||
export { default as useImageOnLoad } from './useImageOnLoad/useImageOnLoad' | ||
export * from './useImageOnLoad/useImageOnLoad' | ||
export { default as useIntersectionObserver } from './useIntersectionObserver/useIntersectionObserver' | ||
export * from './useIntersectionObserver/useIntersectionObserver' | ||
export { default as useInterval } from './useInterval/useInterval' | ||
export * from './useInterval/useInterval' | ||
export { default as useIsClient } from './useIsClient/useIsClient' | ||
export * from './useIsClient/useIsClient' | ||
export { default as useIsFirstRender } from './useIsFirstRender/useIsFirstRender' | ||
export * from './useIsFirstRender/useIsFirstRender' | ||
export { default as useIsMounted } from './useIsMounted/useIsMounted' | ||
export * from './useIsMounted/useIsMounted' | ||
export { default as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect/useIsomorphicLayoutEffect' | ||
export * from './useIsomorphicLayoutEffect/useIsomorphicLayoutEffect' | ||
export { default as useLocalStorage } from './useLocalStorage/useLocalStorage' | ||
export * from './useLocalStorage/useLocalStorage' | ||
export { default as useLockedBody } from './useLockedBody/useLockedBody' | ||
export * from './useLockedBody/useLockedBody' | ||
export { default as useMap } from './useMap/useMap' | ||
export * from './useMap/useMap' | ||
export { default as useMediaQuery } from './useMediaQuery/useMediaQuery' | ||
export * from './useMediaQuery/useMediaQuery' | ||
export { default as useOnClickOutside } from './useOnClickOutside/useOnClickOutside' | ||
export * from './useOnClickOutside/useOnClickOutside' | ||
export { default as useReadLocalStorage } from './useReadLocalStorage/useReadLocalStorage' | ||
export * from './useReadLocalStorage/useReadLocalStorage' | ||
export { default as useScreen } from './useScreen/useScreen' | ||
export * from './useScreen/useScreen' | ||
export { default as useScript } from './useScript/useScript' | ||
export * from './useScript/useScript' | ||
export { default as useSessionStorage } from './useSessionStorage/useSessionStorage' | ||
export * from './useSessionStorage/useSessionStorage' | ||
export { default as useSsr } from './useSsr/useSsr' | ||
export * from './useSsr/useSsr' | ||
export { default as useStep } from './useStep/useStep' | ||
export * from './useStep/useStep' | ||
export { default as useTernaryDarkMode } from './useTernaryDarkMode/useTernaryDarkMode' | ||
export * from './useTernaryDarkMode/useTernaryDarkMode' | ||
export { default as useTimeout } from './useTimeout/useTimeout' | ||
export * from './useTimeout/useTimeout' | ||
export { default as useToggle } from './useToggle/useToggle' | ||
export * from './useToggle/useToggle' | ||
export { default as useUpdateEffect } from './useUpdateEffect/useUpdateEffect' | ||
export * from './useUpdateEffect/useUpdateEffect' | ||
export { default as useWindowSize } from './useWindowSize/useWindowSize' | ||
export * from './useWindowSize/useWindowSize' |
5 changes: 0 additions & 5 deletions
5
...usehooks-ts/src/useBoolean/useBoolean.mdx → .../usehooks-ts/src/useBoolean/useBoolean.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
...src/useClickAnyWhere/useClickAnyWhere.mdx → .../src/useClickAnyWhere/useClickAnyWhere.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
--- | ||
title: useClickAnyWhere | ||
date: '2021-11-17' | ||
--- | ||
|
||
This simple React hook offers you a click event listener at the page level, don't repeat yourself. | ||
|
||
It is made on the [useEventListener](/react-hook/use-event-listener). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
...useCopyToClipboard/useCopyToClipboard.mdx → .../useCopyToClipboard/useCopyToClipboard.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
--- | ||
title: useCopyToClipboard | ||
date: '2021-08-04' | ||
--- | ||
|
||
This React hook provides a `copy` method to save a string in the [clipboard](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard) and the copied value (default: `null`). | ||
|
||
If anything doesn't work, it prints a warning in the console and the value will be `null`. |
2 changes: 1 addition & 1 deletion
2
packages/usehooks-ts/src/useCopyToClipboard/useCopyToClipboard.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
...ooks-ts/src/useCountdown/useCountdown.mdx → ...hooks-ts/src/useCountdown/useCountdown.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
...usehooks-ts/src/useCounter/useCounter.mdx → .../usehooks-ts/src/useCounter/useCounter.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
--- | ||
title: useCounter | ||
date: '2021-07-29' | ||
--- | ||
|
||
A simple abstraction to play with a counter, don't repeat yourself. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
...ehooks-ts/src/useDarkMode/useDarkMode.mdx → ...sehooks-ts/src/useDarkMode/useDarkMode.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
...ehooks-ts/src/useDebounce/useDebounce.mdx → ...sehooks-ts/src/useDebounce/useDebounce.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
...src/useDocumentTitle/useDocumentTitle.mdx → .../src/useDocumentTitle/useDocumentTitle.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
--- | ||
title: useDocumentTitle | ||
date: '2022-09-29' | ||
--- | ||
|
||
An easy way to set the title of the current document. |
2 changes: 1 addition & 1 deletion
2
packages/usehooks-ts/src/useDocumentTitle/useDocumentTitle.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { useIsomorphicLayoutEffect } from '..' | ||
|
||
function useDocumentTitle(title: string): void { | ||
export function useDocumentTitle(title: string): void { | ||
useIsomorphicLayoutEffect(() => { | ||
window.document.title = title | ||
}, [title]) | ||
} | ||
|
||
export default useDocumentTitle |
5 changes: 0 additions & 5 deletions
5
...ks-ts/src/useEffectOnce/useEffectOnce.mdx → ...oks-ts/src/useEffectOnce/useEffectOnce.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { EffectCallback, useEffect } from 'react' | ||
|
||
function useEffectOnce(effect: EffectCallback) { | ||
export function useEffectOnce(effect: EffectCallback) { | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
useEffect(effect, []) | ||
} | ||
|
||
export default useEffectOnce |
5 changes: 0 additions & 5 deletions
5
...-ts/src/useElementSize/useElementSize.mdx → ...s-ts/src/useElementSize/useElementSize.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,2 @@ | ||
--- | ||
title: useElementSize | ||
date: '2020-06-29' | ||
--- | ||
|
||
This hook helps you to dynamically recover the width and the height of an HTML element. | ||
Dimensions are updated on load, on mount/un-mount, when resizing the window and when the ref changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.