Skip to content

Commit

Permalink
chore: usePagination: remove prePaginatedRows from state
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanmylee committed May 13, 2022
1 parent 6c69e6e commit ae29e65
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib/plugins/usePagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ export interface PaginationConfig {
initialPageSize?: number;
}

export interface PaginationState<Item> {
export interface PaginationState {
pageSize: Writable<number>;
pageIndex: Writable<number>;
pageCount: Readable<number>;
prePaginatedRows: Readable<BodyRow<Item>[]>;
hasPreviousPage: Readable<boolean>;
hasNextPage: Readable<boolean>;
}
Expand Down Expand Up @@ -70,7 +69,7 @@ export interface PageStoreConfig {
export const usePagination =
<Item>({ initialPageIndex = 0, initialPageSize = 10 }: PaginationConfig = {}): TablePlugin<
Item,
PaginationState<Item>,
PaginationState,
Record<string, never>,
NewTablePropSet<never>
> =>
Expand All @@ -82,10 +81,9 @@ export const usePagination =
initialPageIndex,
initialPageSize,
});
const pluginState: PaginationState<Item> = {
const pluginState: PaginationState = {
pageSize,
pageIndex,
prePaginatedRows,
pageCount,
hasPreviousPage,
hasNextPage,
Expand Down

0 comments on commit ae29e65

Please sign in to comment.