From 8cca7eee36e82bcb931566e5dd6e28775429ce73 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Mon, 9 Sep 2024 03:16:33 +0800 Subject: [PATCH] chore: add missing jsdoc --- src/use-is-online/index.ts | 3 ++- src/use-page-visibility/index.ts | 1 + src/use-typescript-happy-callback/index.ts | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/use-is-online/index.ts b/src/use-is-online/index.ts index 42cf6732..e931cffd 100644 --- a/src/use-is-online/index.ts +++ b/src/use-is-online/index.ts @@ -19,7 +19,8 @@ const getSnapshot: Parameters[1] = () => { return navigator.onLine; }; -export function usePageVisibility() { +/** @see https://foxact.skk.moe/use-is-online */ +export function useIsOnline() { return useSyncExternalStore( subscribe, getSnapshot, diff --git a/src/use-page-visibility/index.ts b/src/use-page-visibility/index.ts index 03bb56ce..5bb21398 100644 --- a/src/use-page-visibility/index.ts +++ b/src/use-page-visibility/index.ts @@ -17,6 +17,7 @@ const getSnapshot: Parameters[1] = () => { return !document.hidden; }; +/** @see https://foxact.skk.moe/use-page-visibility */ export function usePageVisibility() { return useSyncExternalStore( handlePageVisibilityChange, diff --git a/src/use-typescript-happy-callback/index.ts b/src/use-typescript-happy-callback/index.ts index 4b37ddef..03a79161 100644 --- a/src/use-typescript-happy-callback/index.ts +++ b/src/use-typescript-happy-callback/index.ts @@ -1,7 +1,10 @@ import { useCallback as useCallbackFromReact } from 'react'; +/** @see https://foxact.skk.moe/use-typescript-happy-callback */ export const useTypeScriptHappyCallback: ( fn: (...args: Args) => R, deps: React.DependencyList ) => (...args: Args) => R = useCallbackFromReact; + +/** @see https://foxact.skk.moe/use-typescript-happy-callback */ export const useCallback = useTypeScriptHappyCallback;