@siberiacancode/reactuse 0.2.25 → 0.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/helpers/createStore/createStore.cjs +1 -1
- package/dist/cjs/helpers/createStore/createStore.cjs.map +1 -1
- package/dist/cjs/hooks/useActiveElement/useActiveElement.cjs +1 -1
- package/dist/cjs/hooks/useActiveElement/useActiveElement.cjs.map +1 -1
- package/dist/cjs/hooks/useAsync/useAsync.cjs.map +1 -1
- package/dist/cjs/hooks/useAutoScroll/useAutoScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useBoolean/useBoolean.cjs.map +1 -1
- package/dist/cjs/hooks/useBrowserLanguage/useBrowserLanguage.cjs.map +1 -1
- package/dist/cjs/hooks/useClickOutside/useClickOutside.cjs.map +1 -1
- package/dist/cjs/hooks/useCookie/useCookie.cjs.map +1 -1
- package/dist/cjs/hooks/useCookies/useCookies.cjs.map +1 -1
- package/dist/cjs/hooks/useCounter/useCounter.cjs.map +1 -1
- package/dist/cjs/hooks/useCssVar/useCssVar.cjs +1 -1
- package/dist/cjs/hooks/useCssVar/useCssVar.cjs.map +1 -1
- package/dist/cjs/hooks/useDefault/useDefault.cjs.map +1 -1
- package/dist/cjs/hooks/useDisclosure/useDisclosure.cjs.map +1 -1
- package/dist/cjs/hooks/useDisplayMedia/useDisplayMedia.cjs.map +1 -1
- package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.cjs.map +1 -1
- package/dist/cjs/hooks/useDoubleClick/useDoubleClick.cjs.map +1 -1
- package/dist/cjs/hooks/useElementSize/useElementSize.cjs.map +1 -1
- package/dist/cjs/hooks/useEvent/useEvent.cjs.map +1 -1
- package/dist/cjs/hooks/useEventSource/useEventSource.cjs.map +1 -1
- package/dist/cjs/hooks/useField/useField.cjs.map +1 -1
- package/dist/cjs/hooks/useFileDialog/useFileDialog.cjs.map +1 -1
- package/dist/cjs/hooks/useFocus/useFocus.cjs.map +1 -1
- package/dist/cjs/hooks/useFps/useFps.cjs.map +1 -1
- package/dist/cjs/hooks/useHash/useHash.cjs.map +1 -1
- package/dist/cjs/hooks/useHover/useHover.cjs.map +1 -1
- package/dist/cjs/hooks/useImage/useImage.cjs.map +1 -1
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.cjs +1 -1
- package/dist/cjs/hooks/useInfiniteScroll/useInfiniteScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.cjs +1 -1
- package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.cjs.map +1 -1
- package/dist/cjs/hooks/useLastChanged/useLastChanged.cjs.map +1 -1
- package/dist/cjs/hooks/useList/useList.cjs.map +1 -1
- package/dist/cjs/hooks/useLocalStorage/useLocalStorage.cjs.map +1 -1
- package/dist/cjs/hooks/useLockCallback/useLockCallback.cjs.map +1 -1
- package/dist/cjs/hooks/useLockScroll/useLockScroll.cjs +2 -0
- package/dist/cjs/hooks/useLockScroll/useLockScroll.cjs.map +1 -0
- package/dist/cjs/hooks/useLogger/useLogger.cjs.map +1 -1
- package/dist/cjs/hooks/useLongPress/useLongPress.cjs.map +1 -1
- package/dist/cjs/hooks/useMap/useMap.cjs.map +1 -1
- package/dist/cjs/hooks/useMutation/useMutation.cjs.map +1 -1
- package/dist/cjs/hooks/useMutationObserver/useMutationObserver.cjs.map +1 -1
- package/dist/cjs/hooks/useNetwork/useNetwork.cjs.map +1 -1
- package/dist/cjs/hooks/useOffsetPagination/useOffsetPagination.cjs.map +1 -1
- package/dist/cjs/hooks/useOnline/useOnline.cjs.map +1 -1
- package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.cjs.map +1 -1
- package/dist/cjs/hooks/useOptimistic/useOptimistic.cjs.map +1 -1
- package/dist/cjs/hooks/useOrientation/useOrientation.cjs +1 -1
- package/dist/cjs/hooks/useOrientation/useOrientation.cjs.map +1 -1
- package/dist/cjs/hooks/usePaint/usePaint.cjs.map +1 -1
- package/dist/cjs/hooks/useParallax/useParallax.cjs +1 -1
- package/dist/cjs/hooks/useParallax/useParallax.cjs.map +1 -1
- package/dist/cjs/hooks/usePointerLock/usePointerLock.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredColorScheme/usePreferredColorScheme.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredContrast/usePreferredContrast.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredDark/usePreferredDark.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.cjs.map +1 -1
- package/dist/cjs/hooks/usePreferredReducedMotion/usePreferredReducedMotion.cjs.map +1 -1
- package/dist/cjs/hooks/useQuery/useQuery.cjs.map +1 -1
- package/dist/cjs/hooks/useQueue/useQueue.cjs.map +1 -1
- package/dist/cjs/hooks/useRaf/useRaf.cjs.map +1 -1
- package/dist/cjs/hooks/{useRafValue/useRafValue.cjs → useRafState/useRafState.cjs} +2 -2
- package/dist/cjs/hooks/useRafState/useRafState.cjs.map +1 -0
- package/dist/cjs/hooks/useRefState/useRefState.cjs.map +1 -1
- package/dist/cjs/hooks/useRenderCount/useRenderCount.cjs.map +1 -1
- package/dist/cjs/hooks/useRenderInfo/useRenderInfo.cjs.map +1 -1
- package/dist/cjs/hooks/useRerender/useRerender.cjs.map +1 -1
- package/dist/cjs/hooks/useResizeObserver/useResizeObserver.cjs.map +1 -1
- package/dist/cjs/hooks/useScript/useScript.cjs.map +1 -1
- package/dist/cjs/hooks/useScroll/useScroll.cjs.map +1 -1
- package/dist/cjs/hooks/useSessionStorage/useSessionStorage.cjs.map +1 -1
- package/dist/cjs/hooks/useSet/useSet.cjs.map +1 -1
- package/dist/cjs/hooks/useSpeechRecognition/useSpeechRecognition.cjs.map +1 -1
- package/dist/cjs/hooks/useSpeechSynthesis/useSpeechSynthesis.cjs.map +1 -1
- package/dist/cjs/hooks/useStateHistory/useStateHistory.cjs.map +1 -1
- package/dist/cjs/hooks/useStep/useStep.cjs.map +1 -1
- package/dist/cjs/hooks/useSticky/useSticky.cjs.map +1 -1
- package/dist/cjs/hooks/useStorage/useStorage.cjs.map +1 -1
- package/dist/cjs/hooks/useTextDirection/useTextDirection.cjs +1 -1
- package/dist/cjs/hooks/useTextDirection/useTextDirection.cjs.map +1 -1
- package/dist/cjs/hooks/useToggle/useToggle.cjs.map +1 -1
- package/dist/cjs/hooks/useUrlSearchParam/useUrlSearchParam.cjs.map +1 -1
- package/dist/cjs/hooks/useUrlSearchParams/useUrlSearchParams.cjs.map +1 -1
- package/dist/cjs/hooks/useWizard/useWizard.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/helpers/createStore/createStore.mjs +16 -16
- package/dist/esm/helpers/createStore/createStore.mjs.map +1 -1
- package/dist/esm/hooks/useActiveElement/useActiveElement.mjs +9 -10
- package/dist/esm/hooks/useActiveElement/useActiveElement.mjs.map +1 -1
- package/dist/esm/hooks/useAsync/useAsync.mjs.map +1 -1
- package/dist/esm/hooks/useAutoScroll/useAutoScroll.mjs.map +1 -1
- package/dist/esm/hooks/useBoolean/useBoolean.mjs.map +1 -1
- package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.mjs.map +1 -1
- package/dist/esm/hooks/useClickOutside/useClickOutside.mjs.map +1 -1
- package/dist/esm/hooks/useCookie/useCookie.mjs.map +1 -1
- package/dist/esm/hooks/useCookies/useCookies.mjs.map +1 -1
- package/dist/esm/hooks/useCounter/useCounter.mjs.map +1 -1
- package/dist/esm/hooks/useCssVar/useCssVar.mjs +27 -24
- package/dist/esm/hooks/useCssVar/useCssVar.mjs.map +1 -1
- package/dist/esm/hooks/useDefault/useDefault.mjs.map +1 -1
- package/dist/esm/hooks/useDisclosure/useDisclosure.mjs.map +1 -1
- package/dist/esm/hooks/useDisplayMedia/useDisplayMedia.mjs.map +1 -1
- package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.mjs +3 -1
- package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.mjs.map +1 -1
- package/dist/esm/hooks/useDoubleClick/useDoubleClick.mjs.map +1 -1
- package/dist/esm/hooks/useElementSize/useElementSize.mjs.map +1 -1
- package/dist/esm/hooks/useEvent/useEvent.mjs.map +1 -1
- package/dist/esm/hooks/useEventSource/useEventSource.mjs +3 -1
- package/dist/esm/hooks/useEventSource/useEventSource.mjs.map +1 -1
- package/dist/esm/hooks/useField/useField.mjs.map +1 -1
- package/dist/esm/hooks/useFileDialog/useFileDialog.mjs.map +1 -1
- package/dist/esm/hooks/useFocus/useFocus.mjs.map +1 -1
- package/dist/esm/hooks/useFps/useFps.mjs.map +1 -1
- package/dist/esm/hooks/useHash/useHash.mjs.map +1 -1
- package/dist/esm/hooks/useHover/useHover.mjs.map +1 -1
- package/dist/esm/hooks/useImage/useImage.mjs.map +1 -1
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.mjs +27 -27
- package/dist/esm/hooks/useInfiniteScroll/useInfiniteScroll.mjs.map +1 -1
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.mjs +5 -5
- package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.mjs.map +1 -1
- package/dist/esm/hooks/useLastChanged/useLastChanged.mjs.map +1 -1
- package/dist/esm/hooks/useList/useList.mjs +15 -6
- package/dist/esm/hooks/useList/useList.mjs.map +1 -1
- package/dist/esm/hooks/useLocalStorage/useLocalStorage.mjs.map +1 -1
- package/dist/esm/hooks/useLockCallback/useLockCallback.mjs.map +1 -1
- package/dist/esm/hooks/useLockScroll/useLockScroll.mjs +44 -0
- package/dist/esm/hooks/useLockScroll/useLockScroll.mjs.map +1 -0
- package/dist/esm/hooks/useLogger/useLogger.mjs.map +1 -1
- package/dist/esm/hooks/useLongPress/useLongPress.mjs.map +1 -1
- package/dist/esm/hooks/useMap/useMap.mjs.map +1 -1
- package/dist/esm/hooks/useMutation/useMutation.mjs.map +1 -1
- package/dist/esm/hooks/useMutationObserver/useMutationObserver.mjs.map +1 -1
- package/dist/esm/hooks/useNetwork/useNetwork.mjs.map +1 -1
- package/dist/esm/hooks/useOffsetPagination/useOffsetPagination.mjs.map +1 -1
- package/dist/esm/hooks/useOnline/useOnline.mjs.map +1 -1
- package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.mjs.map +1 -1
- package/dist/esm/hooks/useOptimistic/useOptimistic.mjs.map +1 -1
- package/dist/esm/hooks/useOrientation/useOrientation.mjs +25 -9
- package/dist/esm/hooks/useOrientation/useOrientation.mjs.map +1 -1
- package/dist/esm/hooks/usePaint/usePaint.mjs +14 -2
- package/dist/esm/hooks/usePaint/usePaint.mjs.map +1 -1
- package/dist/esm/hooks/useParallax/useParallax.mjs +9 -9
- package/dist/esm/hooks/useParallax/useParallax.mjs.map +1 -1
- package/dist/esm/hooks/usePointerLock/usePointerLock.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredColorScheme/usePreferredColorScheme.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredContrast/usePreferredContrast.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredDark/usePreferredDark.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.mjs.map +1 -1
- package/dist/esm/hooks/usePreferredReducedMotion/usePreferredReducedMotion.mjs.map +1 -1
- package/dist/esm/hooks/useQuery/useQuery.mjs.map +1 -1
- package/dist/esm/hooks/useQueue/useQueue.mjs.map +1 -1
- package/dist/esm/hooks/useRaf/useRaf.mjs.map +1 -1
- package/dist/esm/hooks/{useRafValue/useRafValue.mjs → useRafState/useRafState.mjs} +2 -2
- package/dist/esm/hooks/useRafState/useRafState.mjs.map +1 -0
- package/dist/esm/hooks/useRefState/useRefState.mjs.map +1 -1
- package/dist/esm/hooks/useRenderCount/useRenderCount.mjs.map +1 -1
- package/dist/esm/hooks/useRenderInfo/useRenderInfo.mjs.map +1 -1
- package/dist/esm/hooks/useRerender/useRerender.mjs.map +1 -1
- package/dist/esm/hooks/useResizeObserver/useResizeObserver.mjs.map +1 -1
- package/dist/esm/hooks/useScript/useScript.mjs.map +1 -1
- package/dist/esm/hooks/useScroll/useScroll.mjs.map +1 -1
- package/dist/esm/hooks/useSessionStorage/useSessionStorage.mjs.map +1 -1
- package/dist/esm/hooks/useSet/useSet.mjs.map +1 -1
- package/dist/esm/hooks/useSpeechRecognition/useSpeechRecognition.mjs +14 -4
- package/dist/esm/hooks/useSpeechRecognition/useSpeechRecognition.mjs.map +1 -1
- package/dist/esm/hooks/useSpeechSynthesis/useSpeechSynthesis.mjs.map +1 -1
- package/dist/esm/hooks/useStateHistory/useStateHistory.mjs.map +1 -1
- package/dist/esm/hooks/useStep/useStep.mjs.map +1 -1
- package/dist/esm/hooks/useSticky/useSticky.mjs.map +1 -1
- package/dist/esm/hooks/useStorage/useStorage.mjs.map +1 -1
- package/dist/esm/hooks/useTextDirection/useTextDirection.mjs +19 -20
- package/dist/esm/hooks/useTextDirection/useTextDirection.mjs.map +1 -1
- package/dist/esm/hooks/useToggle/useToggle.mjs.map +1 -1
- package/dist/esm/hooks/useUrlSearchParam/useUrlSearchParam.mjs.map +1 -1
- package/dist/esm/hooks/useUrlSearchParams/useUrlSearchParams.mjs.map +1 -1
- package/dist/esm/hooks/useWizard/useWizard.mjs.map +1 -1
- package/dist/esm/index.mjs +323 -323
- package/dist/types/helpers/createStore/createStore.d.ts +1 -1
- package/dist/types/hooks/async.d.ts +5 -0
- package/dist/types/hooks/browser.d.ts +32 -0
- package/dist/types/hooks/debug.d.ts +4 -0
- package/dist/types/hooks/elements.d.ts +14 -0
- package/dist/types/hooks/fun.d.ts +3 -0
- package/dist/types/hooks/index.d.ts +11 -143
- package/dist/types/hooks/lifecycle.d.ts +6 -0
- package/dist/types/hooks/sensors.d.ts +34 -0
- package/dist/types/hooks/state.d.ts +25 -0
- package/dist/types/hooks/time.d.ts +5 -0
- package/dist/types/hooks/useAsync/useAsync.d.ts +1 -1
- package/dist/types/hooks/useAutoScroll/useAutoScroll.d.ts +1 -1
- package/dist/types/hooks/useBoolean/useBoolean.d.ts +1 -1
- package/dist/types/hooks/useBrowserLanguage/useBrowserLanguage.d.ts +1 -1
- package/dist/types/hooks/useClickOutside/useClickOutside.d.ts +1 -1
- package/dist/types/hooks/useCookie/useCookie.d.ts +1 -1
- package/dist/types/hooks/useCookies/useCookies.d.ts +1 -1
- package/dist/types/hooks/useCounter/useCounter.d.ts +1 -1
- package/dist/types/hooks/useCssVar/useCssVar.d.ts +1 -1
- package/dist/types/hooks/useDefault/useDefault.d.ts +1 -1
- package/dist/types/hooks/useDisclosure/useDisclosure.d.ts +1 -1
- package/dist/types/hooks/useDocumentTitle/useDocumentTitle.d.ts +2 -0
- package/dist/types/hooks/useDoubleClick/useDoubleClick.d.ts +1 -1
- package/dist/types/hooks/useEvent/useEvent.d.ts +1 -1
- package/dist/types/hooks/useField/useField.d.ts +1 -1
- package/dist/types/hooks/useFileDialog/useFileDialog.d.ts +1 -1
- package/dist/types/hooks/useFocus/useFocus.d.ts +1 -1
- package/dist/types/hooks/useFps/useFps.d.ts +1 -1
- package/dist/types/hooks/useHash/useHash.d.ts +1 -1
- package/dist/types/hooks/useHover/useHover.d.ts +1 -1
- package/dist/types/hooks/useImage/useImage.d.ts +1 -1
- package/dist/types/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +7 -6
- package/dist/types/hooks/useLastChanged/useLastChanged.d.ts +1 -1
- package/dist/types/hooks/useList/useList.d.ts +1 -1
- package/dist/types/hooks/useLocalStorage/useLocalStorage.d.ts +1 -1
- package/dist/types/hooks/useLockCallback/useLockCallback.d.ts +1 -1
- package/dist/types/hooks/useLockScroll/useLockScroll.d.ts +49 -0
- package/dist/types/hooks/useLogger/useLogger.d.ts +1 -1
- package/dist/types/hooks/useLongPress/useLongPress.d.ts +1 -1
- package/dist/types/hooks/useMap/useMap.d.ts +1 -1
- package/dist/types/hooks/useMutation/useMutation.d.ts +1 -1
- package/dist/types/hooks/useMutationObserver/useMutationObserver.d.ts +1 -1
- package/dist/types/hooks/useNetwork/useNetwork.d.ts +1 -1
- package/dist/types/hooks/useOffsetPagination/useOffsetPagination.d.ts +1 -1
- package/dist/types/hooks/useOnline/useOnline.d.ts +1 -1
- package/dist/types/hooks/useOperatingSystem/useOperatingSystem.d.ts +1 -1
- package/dist/types/hooks/useOptimistic/useOptimistic.d.ts +1 -1
- package/dist/types/hooks/useOrientation/useOrientation.d.ts +26 -11
- package/dist/types/hooks/usePaint/usePaint.d.ts +1 -1
- package/dist/types/hooks/usePointerLock/usePointerLock.d.ts +1 -1
- package/dist/types/hooks/usePreferredColorScheme/usePreferredColorScheme.d.ts +1 -1
- package/dist/types/hooks/usePreferredContrast/usePreferredContrast.d.ts +1 -1
- package/dist/types/hooks/usePreferredDark/usePreferredDark.d.ts +1 -1
- package/dist/types/hooks/usePreferredLanguages/usePreferredLanguages.d.ts +1 -1
- package/dist/types/hooks/usePreferredReducedMotion/usePreferredReducedMotion.d.ts +1 -1
- package/dist/types/hooks/useQuery/useQuery.d.ts +1 -1
- package/dist/types/hooks/useQueue/useQueue.d.ts +1 -1
- package/dist/types/hooks/useRaf/useRaf.d.ts +1 -1
- package/dist/types/hooks/{useRafValue/useRafValue.d.ts → useRafState/useRafState.d.ts} +6 -6
- package/dist/types/hooks/useRefState/useRefState.d.ts +1 -1
- package/dist/types/hooks/useRenderCount/useRenderCount.d.ts +1 -1
- package/dist/types/hooks/useRenderInfo/useRenderInfo.d.ts +6 -1
- package/dist/types/hooks/useRerender/useRerender.d.ts +1 -1
- package/dist/types/hooks/useResizeObserver/useResizeObserver.d.ts +1 -1
- package/dist/types/hooks/useRightClick/useRightClick.d.ts +37 -0
- package/dist/types/hooks/useScript/useScript.d.ts +1 -1
- package/dist/types/hooks/useSessionStorage/useSessionStorage.d.ts +1 -1
- package/dist/types/hooks/useSet/useSet.d.ts +1 -1
- package/dist/types/hooks/useSpeechRecognition/useSpeechRecognition.d.ts +1 -1
- package/dist/types/hooks/useSpeechSynthesis/useSpeechSynthesis.d.ts +1 -1
- package/dist/types/hooks/useStateHistory/useStateHistory.d.ts +1 -1
- package/dist/types/hooks/useStep/useStep.d.ts +1 -1
- package/dist/types/hooks/useSticky/useSticky.d.ts +1 -1
- package/dist/types/hooks/useStorage/useStorage.d.ts +1 -1
- package/dist/types/hooks/useTextDirection/useTextDirection.d.ts +2 -2
- package/dist/types/hooks/useToggle/useToggle.d.ts +1 -1
- package/dist/types/hooks/useUrlSearchParam/useUrlSearchParam.d.ts +1 -1
- package/dist/types/hooks/useUrlSearchParams/useUrlSearchParams.d.ts +1 -1
- package/dist/types/hooks/useWizard/useWizard.d.ts +1 -1
- package/dist/types/hooks/user.d.ts +7 -0
- package/dist/types/hooks/utilities.d.ts +9 -0
- package/dist/types/utils/helpers/getElement.d.ts +1 -1
- package/package.json +89 -89
- package/dist/cjs/hooks/useRafValue/useRafValue.cjs.map +0 -1
- package/dist/cjs/hooks/useScreenOrientation/useScreenOrientation.cjs +0 -2
- package/dist/cjs/hooks/useScreenOrientation/useScreenOrientation.cjs.map +0 -1
- package/dist/esm/hooks/useRafValue/useRafValue.mjs.map +0 -1
- package/dist/esm/hooks/useScreenOrientation/useScreenOrientation.mjs +0 -31
- package/dist/esm/hooks/useScreenOrientation/useScreenOrientation.mjs.map +0 -1
- package/dist/types/hooks/useScreenOrientation/useScreenOrientation.d.ts +0 -35
|
@@ -24,7 +24,7 @@ export interface StoreApi<Value> {
|
|
|
24
24
|
export declare const createStore: <Value>(createState: StateCreator<Value> | Value) => {
|
|
25
25
|
set: (action: SetStateAction<Value>) => void;
|
|
26
26
|
get: () => Value;
|
|
27
|
-
use: <Selected>(selector
|
|
27
|
+
use: <Selected>(selector?: (state: Value) => Selected) => Value | Selected;
|
|
28
28
|
subscribe: (listener: (state: Value, prevState: Value) => void) => () => boolean;
|
|
29
29
|
};
|
|
30
30
|
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export * from './useAudio/useAudio';
|
|
2
|
+
export * from './useBattery/useBattery';
|
|
3
|
+
export * from './useBluetooth/useBluetooth';
|
|
4
|
+
export * from './useBroadcastChannel/useBroadcastChannel';
|
|
5
|
+
export * from './useClipboard/useClipboard';
|
|
6
|
+
export * from './useCopy/useCopy';
|
|
7
|
+
export * from './useCssVar/useCssVar';
|
|
8
|
+
export * from './useDisplayMedia/useDisplayMedia';
|
|
9
|
+
export * from './useDocumentTitle/useDocumentTitle';
|
|
10
|
+
export * from './useEventSource/useEventSource';
|
|
11
|
+
export * from './useEyeDropper/useEyeDropper';
|
|
12
|
+
export * from './useFavicon/useFavicon';
|
|
13
|
+
export * from './useFps/useFps';
|
|
14
|
+
export * from './useFullscreen/useFullscreen';
|
|
15
|
+
export * from './useGamepad/useGamepad';
|
|
16
|
+
export * from './useGeolocation/useGeolocation';
|
|
17
|
+
export * from './useMediaControls/useMediaControls';
|
|
18
|
+
export * from './useMemory/useMemory';
|
|
19
|
+
export * from './useNetwork/useNetwork';
|
|
20
|
+
export * from './useOnline/useOnline';
|
|
21
|
+
export * from './useOtpCredential/useOtpCredential';
|
|
22
|
+
export * from './usePermission/usePermission';
|
|
23
|
+
export * from './usePictureInPicture/usePictureInPicture';
|
|
24
|
+
export * from './usePointerLock/usePointerLock';
|
|
25
|
+
export * from './usePostMessage/usePostMessage';
|
|
26
|
+
export * from './useRaf/useRaf';
|
|
27
|
+
export * from './useShare/useShare';
|
|
28
|
+
export * from './useSpeechRecognition/useSpeechRecognition';
|
|
29
|
+
export * from './useSpeechSynthesis/useSpeechSynthesis';
|
|
30
|
+
export * from './useVibrate/useVibrate';
|
|
31
|
+
export * from './useWakeLock/useWakeLock';
|
|
32
|
+
export * from './useWebSocket/useWebSocket';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './useActiveElement/useActiveElement';
|
|
2
|
+
export * from './useAutoScroll/useAutoScroll';
|
|
3
|
+
export * from './useClickOutside/useClickOutside';
|
|
4
|
+
export * from './useDoubleClick/useDoubleClick';
|
|
5
|
+
export * from './useDropZone/useDropZone';
|
|
6
|
+
export * from './useFileDialog/useFileDialog';
|
|
7
|
+
export * from './useFocus/useFocus';
|
|
8
|
+
export * from './useHover/useHover';
|
|
9
|
+
export * from './useImage/useImage';
|
|
10
|
+
export * from './useLongPress/useLongPress';
|
|
11
|
+
export * from './usePaint/usePaint';
|
|
12
|
+
export * from './useScript/useScript';
|
|
13
|
+
export * from './useSticky/useSticky';
|
|
14
|
+
export * from './useTextDirection/useTextDirection';
|
|
@@ -1,143 +1,11 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './useClipboard/useClipboard';
|
|
13
|
-
export * from './useConst/useConst';
|
|
14
|
-
export * from './useCookie/useCookie';
|
|
15
|
-
export * from './useCookies/useCookies';
|
|
16
|
-
export * from './useCopy/useCopy';
|
|
17
|
-
export * from './useCounter/useCounter';
|
|
18
|
-
export * from './useCssVar/useCssVar';
|
|
19
|
-
export * from './useDebounceCallback/useDebounceCallback';
|
|
20
|
-
export * from './useDebounceValue/useDebounceValue';
|
|
21
|
-
export * from './useDefault/useDefault';
|
|
22
|
-
export * from './useDeviceMotion/useDeviceMotion';
|
|
23
|
-
export * from './useDeviceOrientation/useDeviceOrientation';
|
|
24
|
-
export * from './useDevicePixelRatio/useDevicePixelRatio';
|
|
25
|
-
export * from './useDidUpdate/useDidUpdate';
|
|
26
|
-
export * from './useDisclosure/useDisclosure';
|
|
27
|
-
export * from './useDisplayMedia/useDisplayMedia';
|
|
28
|
-
export * from './useDocumentEvent/useDocumentEvent';
|
|
29
|
-
export * from './useDocumentTitle/useDocumentTitle';
|
|
30
|
-
export * from './useDocumentVisibility/useDocumentVisibility';
|
|
31
|
-
export * from './useDoubleClick/useDoubleClick';
|
|
32
|
-
export * from './useDropZone/useDropZone';
|
|
33
|
-
export * from './useElementSize/useElementSize';
|
|
34
|
-
export * from './useEvent/useEvent';
|
|
35
|
-
export * from './useEventListener/useEventListener';
|
|
36
|
-
export * from './useEventSource/useEventSource';
|
|
37
|
-
export * from './useEyeDropper/useEyeDropper';
|
|
38
|
-
export * from './useFavicon/useFavicon';
|
|
39
|
-
export * from './useField/useField';
|
|
40
|
-
export * from './useFileDialog/useFileDialog';
|
|
41
|
-
export * from './useFocus/useFocus';
|
|
42
|
-
export * from './useFps/useFps';
|
|
43
|
-
export * from './useFul/useFul';
|
|
44
|
-
export * from './useFullscreen/useFullscreen';
|
|
45
|
-
export * from './useGamepad/useGamepad';
|
|
46
|
-
export * from './useGeolocation/useGeolocation';
|
|
47
|
-
export * from './useHash/useHash';
|
|
48
|
-
export * from './useHotkeys/useHotkeys';
|
|
49
|
-
export * from './useHover/useHover';
|
|
50
|
-
export * from './useIdle/useIdle';
|
|
51
|
-
export * from './useImage/useImage';
|
|
52
|
-
export * from './useInfiniteScroll/useInfiniteScroll';
|
|
53
|
-
export * from './useIntersectionObserver/useIntersectionObserver';
|
|
54
|
-
export * from './useInterval/useInterval';
|
|
55
|
-
export * from './useIsFirstRender/useIsFirstRender';
|
|
56
|
-
export * from './useIsomorphicLayoutEffect/useIsomorphicLayoutEffect';
|
|
57
|
-
export * from './useKeyboard/useKeyboard';
|
|
58
|
-
export * from './useKeyPress/useKeyPress';
|
|
59
|
-
export * from './useKeyPressEvent/useKeyPressEvent';
|
|
60
|
-
export * from './useKeysPressed/useKeysPressed';
|
|
61
|
-
export * from './useLastChanged/useLastChanged';
|
|
62
|
-
export * from './useLatest/useLatest';
|
|
63
|
-
export * from './useLess/useLess';
|
|
64
|
-
export * from './useList/useList';
|
|
65
|
-
export * from './useLocalStorage/useLocalStorage';
|
|
66
|
-
export * from './useLockCallback/useLockCallback';
|
|
67
|
-
export * from './useLogger/useLogger';
|
|
68
|
-
export * from './useLongPress/useLongPress';
|
|
69
|
-
export * from './useMap/useMap';
|
|
70
|
-
export * from './useMeasure/useMeasure';
|
|
71
|
-
export * from './useMediaControls/useMediaControls';
|
|
72
|
-
export * from './useMediaQuery/useMediaQuery';
|
|
73
|
-
export * from './useMemory/useMemory';
|
|
74
|
-
export * from './useMount/useMount';
|
|
75
|
-
export * from './useMouse/useMouse';
|
|
76
|
-
export * from './useMutation/useMutation';
|
|
77
|
-
export * from './useMutationObserver/useMutationObserver';
|
|
78
|
-
export * from './useNetwork/useNetwork';
|
|
79
|
-
export * from './useOffsetPagination/useOffsetPagination';
|
|
80
|
-
export * from './useOnce/useOnce';
|
|
81
|
-
export * from './useOnline/useOnline';
|
|
82
|
-
export * from './useOperatingSystem/useOperatingSystem';
|
|
83
|
-
export * from './useOptimistic/useOptimistic';
|
|
84
|
-
export * from './useOrientation/useOrientation';
|
|
85
|
-
export * from './useOtpCredential/useOtpCredential';
|
|
86
|
-
export * from './usePageLeave/usePageLeave';
|
|
87
|
-
export * from './usePaint/usePaint';
|
|
88
|
-
export * from './useParallax/useParallax';
|
|
89
|
-
export * from './usePerformanceObserver/usePerformanceObserver';
|
|
90
|
-
export * from './usePermission/usePermission';
|
|
91
|
-
export * from './usePictureInPicture/usePictureInPicture';
|
|
92
|
-
export * from './usePointerLock/usePointerLock';
|
|
93
|
-
export * from './usePostMessage/usePostMessage';
|
|
94
|
-
export * from './usePreferredColorScheme/usePreferredColorScheme';
|
|
95
|
-
export * from './usePreferredContrast/usePreferredContrast';
|
|
96
|
-
export * from './usePreferredDark/usePreferredDark';
|
|
97
|
-
export * from './usePreferredLanguages/usePreferredLanguages';
|
|
98
|
-
export * from './usePreferredReducedMotion/usePreferredReducedMotion';
|
|
99
|
-
export * from './usePrevious/usePrevious';
|
|
100
|
-
export * from './useQuery/useQuery';
|
|
101
|
-
export * from './useQueue/useQueue';
|
|
102
|
-
export * from './useRaf/useRaf';
|
|
103
|
-
export * from './useRafValue/useRafValue';
|
|
104
|
-
export * from './useRefState/useRefState';
|
|
105
|
-
export * from './useRenderCount/useRenderCount';
|
|
106
|
-
export * from './useRenderInfo/useRenderInfo';
|
|
107
|
-
export * from './useRerender/useRerender';
|
|
108
|
-
export * from './useResizeObserver/useResizeObserver';
|
|
109
|
-
export * from './useScreenOrientation/useScreenOrientation';
|
|
110
|
-
export * from './useScript/useScript';
|
|
111
|
-
export * from './useScroll/useScroll';
|
|
112
|
-
export * from './useScrollIntoView/useScrollIntoView';
|
|
113
|
-
export * from './useScrollTo/useScrollTo';
|
|
114
|
-
export * from './useSessionStorage/useSessionStorage';
|
|
115
|
-
export * from './useSet/useSet';
|
|
116
|
-
export * from './useShallowEffect/useShallowEffect';
|
|
117
|
-
export * from './useShare/useShare';
|
|
118
|
-
export * from './useSpeechRecognition/useSpeechRecognition';
|
|
119
|
-
export * from './useSpeechSynthesis/useSpeechSynthesis';
|
|
120
|
-
export * from './useStateHistory/useStateHistory';
|
|
121
|
-
export * from './useStep/useStep';
|
|
122
|
-
export * from './useSticky/useSticky';
|
|
123
|
-
export * from './useStopwatch/useStopwatch';
|
|
124
|
-
export * from './useStorage/useStorage';
|
|
125
|
-
export * from './useTextDirection/useTextDirection';
|
|
126
|
-
export * from './useTextSelection/useTextSelection';
|
|
127
|
-
export * from './useThrottleCallback/useThrottleCallback';
|
|
128
|
-
export * from './useThrottleValue/useThrottleValue';
|
|
129
|
-
export * from './useTime/useTime';
|
|
130
|
-
export * from './useTimeout/useTimeout';
|
|
131
|
-
export * from './useTimer/useTimer';
|
|
132
|
-
export * from './useToggle/useToggle';
|
|
133
|
-
export * from './useUnmount/useUnmount';
|
|
134
|
-
export * from './useUrlSearchParam/useUrlSearchParam';
|
|
135
|
-
export * from './useUrlSearchParams/useUrlSearchParams';
|
|
136
|
-
export * from './useVibrate/useVibrate';
|
|
137
|
-
export * from './useWakeLock/useWakeLock';
|
|
138
|
-
export * from './useWebSocket/useWebSocket';
|
|
139
|
-
export * from './useWindowEvent/useWindowEvent';
|
|
140
|
-
export * from './useWindowFocus/useWindowFocus';
|
|
141
|
-
export * from './useWindowScroll/useWindowScroll';
|
|
142
|
-
export * from './useWindowSize/useWindowSize';
|
|
143
|
-
export * from './useWizard/useWizard';
|
|
1
|
+
export * from './async';
|
|
2
|
+
export * from './browser';
|
|
3
|
+
export * from './debug';
|
|
4
|
+
export * from './elements';
|
|
5
|
+
export * from './fun';
|
|
6
|
+
export * from './lifecycle';
|
|
7
|
+
export * from './sensors';
|
|
8
|
+
export * from './state';
|
|
9
|
+
export * from './time';
|
|
10
|
+
export * from './user';
|
|
11
|
+
export * from './utilities';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './useDidUpdate/useDidUpdate';
|
|
2
|
+
export * from './useIsFirstRender/useIsFirstRender';
|
|
3
|
+
export * from './useIsomorphicLayoutEffect/useIsomorphicLayoutEffect';
|
|
4
|
+
export * from './useMount/useMount';
|
|
5
|
+
export * from './useShallowEffect/useShallowEffect';
|
|
6
|
+
export * from './useUnmount/useUnmount';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export * from './useBreakpoints/useBreakpoints';
|
|
2
|
+
export * from './useDeviceMotion/useDeviceMotion';
|
|
3
|
+
export * from './useDeviceOrientation/useDeviceOrientation';
|
|
4
|
+
export * from './useDevicePixelRatio/useDevicePixelRatio';
|
|
5
|
+
export * from './useDocumentEvent/useDocumentEvent';
|
|
6
|
+
export * from './useDocumentVisibility/useDocumentVisibility';
|
|
7
|
+
export * from './useElementSize/useElementSize';
|
|
8
|
+
export * from './useEventListener/useEventListener';
|
|
9
|
+
export * from './useHotkeys/useHotkeys';
|
|
10
|
+
export * from './useIdle/useIdle';
|
|
11
|
+
export * from './useInfiniteScroll/useInfiniteScroll';
|
|
12
|
+
export * from './useIntersectionObserver/useIntersectionObserver';
|
|
13
|
+
export * from './useKeyboard/useKeyboard';
|
|
14
|
+
export * from './useKeyPress/useKeyPress';
|
|
15
|
+
export * from './useKeyPressEvent/useKeyPressEvent';
|
|
16
|
+
export * from './useKeysPressed/useKeysPressed';
|
|
17
|
+
export * from './useLockScroll/useLockScroll';
|
|
18
|
+
export * from './useMeasure/useMeasure';
|
|
19
|
+
export * from './useMediaQuery/useMediaQuery';
|
|
20
|
+
export * from './useMouse/useMouse';
|
|
21
|
+
export * from './useMutationObserver/useMutationObserver';
|
|
22
|
+
export * from './useOrientation/useOrientation';
|
|
23
|
+
export * from './usePageLeave/usePageLeave';
|
|
24
|
+
export * from './useParallax/useParallax';
|
|
25
|
+
export * from './usePerformanceObserver/usePerformanceObserver';
|
|
26
|
+
export * from './useResizeObserver/useResizeObserver';
|
|
27
|
+
export * from './useScroll/useScroll';
|
|
28
|
+
export * from './useScrollIntoView/useScrollIntoView';
|
|
29
|
+
export * from './useScrollTo/useScrollTo';
|
|
30
|
+
export * from './useTextSelection/useTextSelection';
|
|
31
|
+
export * from './useWindowEvent/useWindowEvent';
|
|
32
|
+
export * from './useWindowFocus/useWindowFocus';
|
|
33
|
+
export * from './useWindowScroll/useWindowScroll';
|
|
34
|
+
export * from './useWindowSize/useWindowSize';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from './useBoolean/useBoolean';
|
|
2
|
+
export * from './useCookie/useCookie';
|
|
3
|
+
export * from './useCookies/useCookies';
|
|
4
|
+
export * from './useCounter/useCounter';
|
|
5
|
+
export * from './useDefault/useDefault';
|
|
6
|
+
export * from './useDisclosure/useDisclosure';
|
|
7
|
+
export * from './useField/useField';
|
|
8
|
+
export * from './useHash/useHash';
|
|
9
|
+
export * from './useList/useList';
|
|
10
|
+
export * from './useLocalStorage/useLocalStorage';
|
|
11
|
+
export * from './useMap/useMap';
|
|
12
|
+
export * from './useOffsetPagination/useOffsetPagination';
|
|
13
|
+
export * from './useQuery/useQuery';
|
|
14
|
+
export * from './useQueue/useQueue';
|
|
15
|
+
export * from './useRafState/useRafState';
|
|
16
|
+
export * from './useRefState/useRefState';
|
|
17
|
+
export * from './useSessionStorage/useSessionStorage';
|
|
18
|
+
export * from './useSet/useSet';
|
|
19
|
+
export * from './useStateHistory/useStateHistory';
|
|
20
|
+
export * from './useStep/useStep';
|
|
21
|
+
export * from './useStorage/useStorage';
|
|
22
|
+
export * from './useToggle/useToggle';
|
|
23
|
+
export * from './useUrlSearchParam/useUrlSearchParam';
|
|
24
|
+
export * from './useUrlSearchParams/useUrlSearchParams';
|
|
25
|
+
export * from './useWizard/useWizard';
|
|
@@ -8,7 +8,7 @@ export interface UseAsyncReturn<Data> {
|
|
|
8
8
|
/**
|
|
9
9
|
* @name useAsync
|
|
10
10
|
* @description - Hook that provides the state of an async callback
|
|
11
|
-
* @category
|
|
11
|
+
* @category Async
|
|
12
12
|
*
|
|
13
13
|
* @param {() => Promise<Data>} callback The async callback
|
|
14
14
|
* @param {DependencyList} deps The dependencies of the callback
|
|
@@ -14,7 +14,7 @@ export interface UseAutoScroll {
|
|
|
14
14
|
/**
|
|
15
15
|
* @name useAutoScroll
|
|
16
16
|
* @description - Hook that automatically scrolls a list element to the bottom
|
|
17
|
-
* @category
|
|
17
|
+
* @category Elements
|
|
18
18
|
*
|
|
19
19
|
* @overload
|
|
20
20
|
* @param {HookTarget} target The target element to auto-scroll
|
|
@@ -8,7 +8,7 @@ export type UseBooleanReturn = [
|
|
|
8
8
|
/**
|
|
9
9
|
* @name useBoolean
|
|
10
10
|
* @description - Hook provides opportunity to manage boolean state
|
|
11
|
-
* @category
|
|
11
|
+
* @category State
|
|
12
12
|
*
|
|
13
13
|
* @param {boolean} [initialValue=false] The initial boolean value
|
|
14
14
|
* @returns {UseBooleanReturn} An object containing the boolean state value and utility functions to manipulate the state
|
|
@@ -7,7 +7,7 @@ export interface UseClickOutside {
|
|
|
7
7
|
/**
|
|
8
8
|
* @name useClickOutside
|
|
9
9
|
* @description - Hook to handle click events outside the specified target element(s)
|
|
10
|
-
* @category
|
|
10
|
+
* @category Elements
|
|
11
11
|
*
|
|
12
12
|
* @overload
|
|
13
13
|
* @param {HookTarget} target The target element(s) to detect outside clicks for
|
|
@@ -19,7 +19,7 @@ export interface UseDisclosureReturn {
|
|
|
19
19
|
/**
|
|
20
20
|
* @name useDisclosure
|
|
21
21
|
* @description - Hook that allows you to open and close a modal
|
|
22
|
-
* @category
|
|
22
|
+
* @category State
|
|
23
23
|
*
|
|
24
24
|
* @param {boolean} [initialValue=false] The initial value of the component
|
|
25
25
|
* @param {() => void} [options.onOpen] The callback function to be invoked on open
|
|
@@ -15,6 +15,8 @@ export interface UseDocumentTitleReturn {
|
|
|
15
15
|
* @description - Hook that manages the document title and allows updating it
|
|
16
16
|
* @category Browser
|
|
17
17
|
*
|
|
18
|
+
* @browserapi document.title https://developer.mozilla.org/en-US/docs/Web/API/Document/title
|
|
19
|
+
*
|
|
18
20
|
* @param {string} [initialValue] The initial title. If not provided, the current document title will be used
|
|
19
21
|
* @param {boolean} [options.restoreOnUnmount] Restore the previous title on unmount
|
|
20
22
|
* @returns {UseDocumentTitleReturn} An array containing the current title and a function to update the title
|
|
@@ -16,7 +16,7 @@ export declare const DEFAULT_THRESHOLD_TIME = 300;
|
|
|
16
16
|
/**
|
|
17
17
|
* @name useDoubleClick
|
|
18
18
|
* @description - Hook that defines the logic when double clicking an element
|
|
19
|
-
* @category
|
|
19
|
+
* @category Elements
|
|
20
20
|
*
|
|
21
21
|
* @overload
|
|
22
22
|
* @param {HookTarget} target The target element to be double clicked
|
|
@@ -20,7 +20,7 @@ export interface UseFileDialog {
|
|
|
20
20
|
/**
|
|
21
21
|
* @name useFileDialog
|
|
22
22
|
* @description - Hook to handle file input
|
|
23
|
-
* @category
|
|
23
|
+
* @category Elements
|
|
24
24
|
*
|
|
25
25
|
* @overload
|
|
26
26
|
* @param {(value: FileList | null) => void} callback The callback to execute when a file is selected
|
|
@@ -3,7 +3,7 @@ type UseHashReturn = [string, (value: string) => void];
|
|
|
3
3
|
/**
|
|
4
4
|
* @name useHash
|
|
5
5
|
* @description - Hook that manages the hash value
|
|
6
|
-
* @category
|
|
6
|
+
* @category State
|
|
7
7
|
*
|
|
8
8
|
* @param {string} [initialValue] The initial hash value if no hash exists
|
|
9
9
|
* @returns {UseHashReturn} An array containing the hash value and a function to set the hash value
|
|
@@ -21,7 +21,7 @@ export type UseImageReturn = UseQueryReturn<HTMLImageElement>;
|
|
|
21
21
|
/**
|
|
22
22
|
* @name useImage
|
|
23
23
|
* @description - Hook that load an image in the browser
|
|
24
|
-
* @category
|
|
24
|
+
* @category Elements
|
|
25
25
|
*
|
|
26
26
|
* @param {string} src The source of the image
|
|
27
27
|
* @param {string} [options.srcset] The srcset of the image
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { HookTarget } from '../../utils/helpers';
|
|
2
2
|
import { StateRef } from '../useRefState/useRefState';
|
|
3
|
+
export type UseIntersectionObserverCallback = (entry: IntersectionObserverEntry) => void;
|
|
3
4
|
/** The intersection observer options type */
|
|
4
5
|
export interface UseIntersectionObserverOptions extends Omit<IntersectionObserverInit, 'root'> {
|
|
5
6
|
enabled?: boolean;
|
|
7
|
+
onChange?: UseIntersectionObserverCallback;
|
|
6
8
|
root?: HookTarget;
|
|
7
|
-
onChange?: (entry: IntersectionObserverEntry) => void;
|
|
8
9
|
}
|
|
9
10
|
/** The intersection observer return type */
|
|
10
11
|
export interface UseIntersectionObserverReturn {
|
|
@@ -16,15 +17,15 @@ export interface UseIntersectionObserver {
|
|
|
16
17
|
ref: StateRef<Target>;
|
|
17
18
|
};
|
|
18
19
|
(target: HookTarget, options?: UseIntersectionObserverOptions): UseIntersectionObserverReturn;
|
|
19
|
-
<Target extends Element>(callback:
|
|
20
|
+
<Target extends Element>(callback: UseIntersectionObserverCallback, target?: never): UseIntersectionObserverReturn & {
|
|
20
21
|
ref: StateRef<Target>;
|
|
21
22
|
};
|
|
22
|
-
(callback:
|
|
23
|
+
(callback: UseIntersectionObserverCallback, target: HookTarget): UseIntersectionObserverReturn;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* @name useIntersectionObserver
|
|
26
27
|
* @description - Hook that gives you intersection observer state
|
|
27
|
-
* @category
|
|
28
|
+
* @category Sensors
|
|
28
29
|
*
|
|
29
30
|
* @browserapi IntersectionObserver https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver
|
|
30
31
|
*
|
|
@@ -50,14 +51,14 @@ export interface UseIntersectionObserver {
|
|
|
50
51
|
*
|
|
51
52
|
* @overload
|
|
52
53
|
* @template Target The target element
|
|
53
|
-
* @param {
|
|
54
|
+
* @param {UseIntersectionObserverCallback} callback The callback to execute when intersection is detected
|
|
54
55
|
* @returns {UseIntersectionObserverReturn & { ref: StateRef<Target> }} A React ref to attach to the target element
|
|
55
56
|
*
|
|
56
57
|
* @example
|
|
57
58
|
* const { ref, entry, inView } = useIntersectionObserver(() => console.log('callback'));
|
|
58
59
|
*
|
|
59
60
|
* @overload
|
|
60
|
-
* @param {
|
|
61
|
+
* @param {UseIntersectionObserverCallback} callback The callback to execute when intersection is detected
|
|
61
62
|
* @param {HookTarget} target The target element to detect intersection
|
|
62
63
|
* @returns {UseIntersectionObserverReturn} An object containing the state
|
|
63
64
|
*
|
|
@@ -5,7 +5,7 @@ export interface UseLastChangedOptions {
|
|
|
5
5
|
/**
|
|
6
6
|
* @name useLastChanged
|
|
7
7
|
* @description - Hook for records the timestamp of the last change
|
|
8
|
-
* @category
|
|
8
|
+
* @category Utilities
|
|
9
9
|
*
|
|
10
10
|
* @param {any} source The source of the last change
|
|
11
11
|
* @param {number | null} [options.initialValue=null] The initial value
|
|
@@ -18,7 +18,7 @@ export interface UseListReturn<Item> {
|
|
|
18
18
|
/**
|
|
19
19
|
* @name useList
|
|
20
20
|
* @description - Hook that provides state and helper methods to manage a list of items
|
|
21
|
-
* @category
|
|
21
|
+
* @category State
|
|
22
22
|
*
|
|
23
23
|
* @template Item The type of the item
|
|
24
24
|
* @param {Item[] | (() => Item[])} initialList The initial list of items
|
|
@@ -2,7 +2,7 @@ import { UseStorageInitialValue, UseStorageOptions } from '../useStorage/useStor
|
|
|
2
2
|
/**
|
|
3
3
|
* @name useLocalStorage
|
|
4
4
|
* @description - Hook that manages local storage value
|
|
5
|
-
* @category
|
|
5
|
+
* @category State
|
|
6
6
|
*
|
|
7
7
|
* @browserapi localStorage https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
|
|
8
8
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name useLockCallback
|
|
3
3
|
* @description - Hook that prevents a callback from being executed multiple times simultaneously
|
|
4
|
-
* @category
|
|
4
|
+
* @category Async
|
|
5
5
|
*
|
|
6
6
|
* @param {Function} callback The callback to be locked
|
|
7
7
|
* @returns {Function} The locked callback
|