Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 37e1701

Browse files
committed
Fix unused export
1 parent f2ff14a commit 37e1701

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

site/src/hooks/usePagination.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const usePagination = ({
99
const [searchParams, setSearchParams] = searchParamsResult;
1010
const page = searchParams.get("page") ? Number(searchParams.get("page")) : 1;
1111
const limit = DEFAULT_RECORDS_PER_PAGE;
12-
const offset = calcOffset(page, limit);
12+
const offset = page <= 0 ? 0 : (page - 1) * limit;
1313

1414
const goToPage = (page: number) => {
1515
searchParams.set("page", page.toString());
@@ -23,7 +23,3 @@ export const usePagination = ({
2323
offset,
2424
};
2525
};
26-
27-
export const calcOffset = (page: number, limit: number) => {
28-
return page <= 0 ? 0 : (page - 1) * limit;
29-
};

0 commit comments

Comments
 (0)