• Preparing search index...
  • The search index is not available
Lens SDK Reference
  • Lens SDK Reference
  • @lens-protocol/react-web
  • Core
  • useLazyProfiles

Function useLazyProfiles

  • useLazyProfiles(): UseDeferredTask<Profile[], UnspecifiedError, FetchProfilesArgs>
  • Experimental

    useLazyProfiles is a lazy version of useProfiles React Hook.

    This version doesn't support pagination!

    This hook will not fetch profiles until the returned function is called.

    This hook is experimental and may change in the future.

    Returns UseDeferredTask<Profile[], UnspecifiedError, FetchProfilesArgs>

    Example

    const { called, data, error, loading, execute } = useLazyProfiles();

    const callback = async () => {
    const result = await execute({
    where: {
    profileIds: ['0x01', '0x02'],
    },
    });

    if (result.isFailure()) {
    toast.error(result.error.message);
    return;
    }

    const profiles = result.value;

    // do something with the profiles
    }
    • Defined in packages/react/src/profile/useLazyProfiles.ts:52

Settings

Member Visibility

Theme

Lens SDK Reference
  • @lens-protocol/react-web - v2.3.2
  • @lens-protocol/react-native - v2.3.2
  • @lens-protocol/client - v2.3.2