CupThread React Native & Expo SDK - v0.1.0
    Preparing search index...

    Interface UseFeatureRequestsResult

    Return type of useFeatureRequests.

    interface UseFeatureRequestsResult {
        applyItemChange: (
            itemId: string,
            transform: (item: FeatureRequestItem) => FeatureRequestItem,
        ) => void;
        error: Error | null;
        hasMore: boolean;
        isLoading: boolean;
        isLoadingMore: boolean;
        isRateLimited: boolean;
        isRefreshing: boolean;
        items: FeatureRequestItem[];
        loadMore: () => Promise<void>;
        loadMoreError: Error | null;
        refresh: () => Promise<void>;
        reload: () => Promise<void>;
        setItems: Dispatch<SetStateAction<FeatureRequestItem[]>>;
        total: number;
    }
    Index
    applyItemChange: (
        itemId: string,
        transform: (item: FeatureRequestItem) => FeatureRequestItem,
    ) => void

    Applies a state transform to a specific item by ID (e.g. for optimistic votes).

    error: Error | null

    Most recent page-0 fetch error (initial load, search/filter change, or pull-to-refresh), if any.

    hasMore: boolean

    Whether there are more items available to fetch from the server.

    isLoading: boolean

    Whether the initial load or a filter/search change request is in flight.

    Note: This reflects whether a page-0 network request is actively in flight. Presentation logic (such as showing a full-screen spinner vs. keeping stale results visible while reloading) is the decision of the consuming screen.

    isLoadingMore: boolean

    Whether a next-page fetch (loadMore) is currently in flight.

    isRateLimited: boolean

    True while the client-side post-429 search cooldown is active. Query searches stay suppressed until it elapses; UI should show a localized rate-limit notice instead of treating this as a generic failure.

    isRefreshing: boolean

    Whether a pull-to-refresh request is currently in flight.

    Accumulated array of loaded feature requests.

    loadMore: () => Promise<void>

    Fetches the next page of items and appends them to items. Safely no-ops if a request is already in flight, no more items remain, or the token is not ready.

    loadMoreError: Error | null

    Most recent next-page (loadMore) fetch error, if any. Kept separate from error so UI can attribute an inline refresh banner and a load-more footer retry independently; cleared by the next successful page-0 or load-more fetch.

    refresh: () => Promise<void>

    Refreshes items from page 0 using pull-to-refresh semantics.

    reload: () => Promise<void>

    Reloads items from page 0 with isLoading = true.

    setItems: Dispatch<SetStateAction<FeatureRequestItem[]>>

    Direct state setter for items.

    total: number

    Total count of matching feature requests reported by server.