Skip to content

Commit 5be6f5c

Browse files
authored
Make paginationStore use the type of the input as the output type (#265)
1 parent b2324a1 commit 5be6f5c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/thick-lemons-yawn.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte-ux": patch
3+
---
4+
5+
Make paginationStore.slice use the type of the input as the output type

packages/svelte-ux/src/lib/stores/paginationStore.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function createState(page: number, perPage: number, total: number) {
5656
hasPrevious: totalPages > 1 && page > 1,
5757
hasNext: page < totalPages,
5858

59-
slice(items: any[]) {
59+
slice<T>(items: T[]) {
6060
return items.slice((page - 1) * perPage, page * perPage);
6161
},
6262
};

0 commit comments

Comments
 (0)