From fcd04e3568cc367ab51f038d4330c73b6f8d8eb1 Mon Sep 17 00:00:00 2001 From: Cesare Naldi Date: Wed, 8 May 2024 22:16:50 +0200 Subject: [PATCH] chore: typedoc fixes --- .changeset/yellow-insects-obey.md | 7 +++++++ packages/react/src/authentication/useSession.ts | 12 +----------- packages/react/src/experimental/credentials.ts | 9 +++++++++ packages/react/src/experimental/useStorage.ts | 3 +++ .../publications/useOptimisticCreatePost.ts | 3 +++ 5 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 .changeset/yellow-insects-obey.md diff --git a/.changeset/yellow-insects-obey.md b/.changeset/yellow-insects-obey.md new file mode 100644 index 0000000000..7130665adf --- /dev/null +++ b/.changeset/yellow-insects-obey.md @@ -0,0 +1,7 @@ +--- +"@lens-protocol/react": patch +"@lens-protocol/react-native": patch +"@lens-protocol/react-web": patch +--- + +**fixes:** typedoc for some hooks diff --git a/packages/react/src/authentication/useSession.ts b/packages/react/src/authentication/useSession.ts index d92a985fda..92a68a7150 100644 --- a/packages/react/src/authentication/useSession.ts +++ b/packages/react/src/authentication/useSession.ts @@ -12,23 +12,13 @@ import { SessionType, } from '@lens-protocol/domain/use-cases/authentication'; import { EvmAddress, invariant, never } from '@lens-protocol/shared-kernel'; -import { useEffect, useRef } from 'react'; +import { useEffect } from 'react'; import { useLensApolloClient } from '../helpers/arguments'; import { ReadResult } from '../helpers/reads'; import { SuspenseEnabled, SuspenseResult } from '../helpers/suspense'; import { useLazyFragmentVariables } from '../helpers/variables'; -export function usePreviousValue(value: T) { - const ref = useRef(); - - useEffect(() => { - ref.current = value; - }, [value]); - - return ref.current; -} - export { LogoutReason, SessionType }; /** diff --git a/packages/react/src/experimental/credentials.ts b/packages/react/src/experimental/credentials.ts index b9acfae6ba..233c20cc5f 100644 --- a/packages/react/src/experimental/credentials.ts +++ b/packages/react/src/experimental/credentials.ts @@ -45,6 +45,9 @@ function useCredentials() { * * @experimental This API is VERY experimental and might change in the future. * @defaultValue `null` if not authenticated. + * + * @category Misc + * @group Hooks */ export function useAccessToken() { const credentials = useCredentials(); @@ -57,6 +60,9 @@ export function useAccessToken() { * * @experimental This API is VERY experimental and might change in the future. * @defaultValue `null` if not authenticated. + * + * @category Misc + * @group Hooks */ export function useIdentityToken() { const credentials = useCredentials(); @@ -69,6 +75,9 @@ export function useIdentityToken() { * * @experimental This API is VERY experimental and might change in the future. * @defaultValue `null` if not authenticated. + * + * @category Misc + * @group Hooks */ export function useRefreshToken() { const credentials = useCredentials(); diff --git a/packages/react/src/experimental/useStorage.ts b/packages/react/src/experimental/useStorage.ts index d57a72c975..13a4a507f7 100644 --- a/packages/react/src/experimental/useStorage.ts +++ b/packages/react/src/experimental/useStorage.ts @@ -2,6 +2,9 @@ import { useSharedDependencies } from '../shared'; /** * Returns the {@link IStorageProvider} or {@link IObservableStorageProvider} instance defined in LensConfig. + * + * @category Misc + * @group Hooks */ export function useStorage() { const { config } = useSharedDependencies(); diff --git a/packages/react/src/transactions/publications/useOptimisticCreatePost.ts b/packages/react/src/transactions/publications/useOptimisticCreatePost.ts index 3f0b46e663..171b271265 100644 --- a/packages/react/src/transactions/publications/useOptimisticCreatePost.ts +++ b/packages/react/src/transactions/publications/useOptimisticCreatePost.ts @@ -263,6 +263,9 @@ export type OptimisticCreatePostError = * ``` * * @experimental This API is experimental and may change or be removed in future versions without honoring semver. + * + * @category Publications + * @group Hooks */ export function useOptimisticCreatePost( uploader: IUploader,