Sanity Library Reference Docs
    Preparing search index...

    Interface UserPreferenceListResult<K>Beta

    What useUserPreferenceList returns.

    interface UserPreferenceListResult<K extends PreferenceListKey> {
        data: UserPreferenceListItem<K>[];
        error: unknown;
        hasMore: boolean;
        isFetching: boolean;
        isPending: boolean;
        loadMore: () => void;
        refetch: () => Promise<UserPreferenceListPage<K>>;
    }

    Type Parameters

    • K extends PreferenceListKey

    Hierarchy

    Index

    Properties

    data: UserPreferenceListItem<K>[]

    The items on the pages read so far, in order.

    error: unknown

    The most recent background-fetch failure while data still renders; cleared by the next success.

    hasMore: boolean

    Whether there's another page to read.

    isFetching: boolean

    A fetch for this entry is in flight (background revalidation or a refetch()).

    isPending: boolean

    Whether the next page is being read.

    loadMore: () => void

    Reads the next page. A failure shows on error, keeping the items read so far.

    refetch: () => Promise<UserPreferenceListPage<K>>

    Imperatively refetch, bypassing staleness. Resolves with the refreshed data.