@netgrif/components-core
Version:
Netgrif Application engine frontend core Angular library
14 lines (13 loc) • 1.01 kB
TypeScript
import { Observable } from 'rxjs';
import { Page } from '../../resources/interface/page';
import { Params } from '../../resources/resource-provider.service';
import { Pagination } from '../../resources/interface/pagination';
/**
* Loads all pages from the given endpoint and returns their content as one array
* @param source the method that is used to load an individual page, it must support pagination parameters
* @param filter the filter/query object that is used to specify the requested objects. The `source` argument must accept this filter.
* @param pagination configuration of the initial pagination.
* Pages will be loaded from the provided page number onwards, page size will be upheld.
* @returns content of all pages from the given page onwards (or from the start if no `pagination` argument was provided) as a single Array
*/
export declare function loadAllPages<T>(source: (filter: any, params: Params) => Observable<Page<T>>, filter: any, pagination?: Pagination): Observable<Array<T>>;