Skip to content

Commit b7bea62

Browse files
committed
move pageCount declaration above if statement
1 parent 229bc8d commit b7bea62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/plugins/addPagination.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export const createPageStore = ({
3636

3737
const pageIndex = writable(initialPageIndex);
3838

39-
let pageCount;
4039
function calcPageCount([$pageSize, $itemsCount]: [$pageSize: number, $itemsCount: number]) {
4140
const $pageCount = Math.ceil($itemsCount / $pageSize);
4241
pageIndex.update(($pageIndex) => {
@@ -49,6 +48,7 @@ export const createPageStore = ({
4948
}
5049

5150
const serverItemsCount = writable(0);
51+
let pageCount;
5252
if (serverSide) {
5353
pageCount = derived([pageSize, serverItemsCount], calcPageCount);
5454
} else {

0 commit comments

Comments
 (0)