Function useOffsetPaginator
- useOffsetPaginator<Data>(__namedParameters): {
clear: (() => void);
data: Data[];
error: boolean;
hasMore: boolean;
loading: boolean;
offset: number;
onSkip: IExecute<void, boolean>;
reloadSubject: TSubject<void>;
setData: ((data: Data[] | ((prevData: Data[]) => Data[])) => void);
} Type Parameters
- Data extends unknown = any
Parameters
- __namedParameters: IParams<Data>
Returns {
clear: (() => void);
data: Data[];
error: boolean;
hasMore: boolean;
loading: boolean;
offset: number;
onSkip: IExecute<void, boolean>;
reloadSubject: TSubject<void>;
setData: ((data: Data[] | ((prevData: Data[]) => Data[])) => void);
}
- An object containing the paginated data and various utility functions.
clear: (() => void)
error: boolean
hasMore: boolean
loading: boolean
offset: number
onSkip: IExecute<void, boolean>
reloadSubject: TSubject<void>
setData: ((data: Data[] | ((prevData: Data[]) => Data[])) => void)
Implements an offset-based pagination logic for fetching and managing data.