Fix order of flattenPages func
This commit is contained in:
parent
b0ea57b9b9
commit
9d20d0d032
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ export interface PaginatedResult<T> {
|
|||
/** Flatten paginated results into a single array. */
|
||||
const flattenPages = <T>(queryInfo: UseInfiniteQueryResult<PaginatedResult<T>>) => {
|
||||
return queryInfo.data?.pages.reduce<T[]>(
|
||||
(prev: T[], curr) => [...prev, ...curr.result],
|
||||
(prev: T[], curr) => [...curr.result, ...prev],
|
||||
[],
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue