UNPKG

@lens-protocol/react

Version:

Interacting with the Lens Protocol API using React.

57 lines (56 loc) 1.73 kB
import { ExploreProfilesRequest, ExploreProfilesWhere, Profile } from '@lens-protocol/api-bindings'; import { PaginatedArgs, PaginatedReadResult } from "../helpers/reads.js"; import { SuspenseEnabled, SuspensePaginatedResult } from "../helpers/suspense.js"; /** * {@link useExploreProfiles} hook arguments */ export type UseExploreProfilesArgs = PaginatedArgs<ExploreProfilesRequest>; export type { ExploreProfilesRequest, ExploreProfilesWhere }; /** * {@link useExploreProfiles} hook arguments with Suspense support */ export type UseSuspenseExploreProfilesArgs = SuspenseEnabled<UseExploreProfilesArgs>; /** * Discover new profiles based on a defined criteria. * * ```tsx * const { data, error, loading } = useExploreProfiles({ * orderBy: ExploreProfilesOrderByType.LatestCreated, * }); * * if (loading) return <Loader />; * * if (error) return <Error message={error.message} />; * * return ( * <> * {data.map((profile) => ( * <Profile key={profile.id} profile={profile} /> * ))} * </> * ); * ``` * * @category Discovery * @group Hooks */ export declare function useExploreProfiles(args?: UseExploreProfilesArgs): PaginatedReadResult<Profile[]>; /** * Discover new profiles based on a defined criteria. * * This signature supports [React Suspense](https://react.dev/reference/react/Suspense). * * ```ts * const { data } = useExploreProfiles({ * orderBy: ExploreProfilesOrderByType.LatestCreated, * suspense: true, * ); * * console.log(data); * ``` * * @experimental This API can change without notice * @category Discovery * @group Hooks */ export declare function useExploreProfiles(args: UseSuspenseExploreProfilesArgs): SuspensePaginatedResult<Profile[]>;