usePagedResource()
Home > @gooddata/sdk-ui > usePagedResource
usePagedResource() function
Hook for getting data from paged resource
Signature:
export declare function usePagedResource<TParams, TItem>(resourceFactory: (params: TParams) => Promise<IPagedResource<TItem>>, fetchParams: TParams[], fetchDeps: React.DependencyList, resetDeps: React.DependencyList, getCacheKey?: (params: TParams) => string, initialState?: IUsePagedResourceState<TItem>, preventResetPromises?: boolean): IUsePagedResourceResult<TItem>;
Parameters
Parameter | Type | Description |
---|---|---|
resourceFactory | (params: TParams) => Promise<IPagedResource<TItem>> | |
fetchParams | TParams[] | |
fetchDeps | React.DependencyList | |
resetDeps | React.DependencyList | |
getCacheKey | (params: TParams) => string | (Optional) |
initialState | IUsePagedResourceState<TItem> | (Optional) |
preventResetPromises | boolean | (Optional) |
Returns:
IUsePagedResourceResult<TItem>