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>): 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) |
Returns:
IUsePagedResourceResult<TItem>