Skip to content

Commit 05f935b

Browse files
committed
feat: usePagination add plugins params
1 parent e64e31e commit 05f935b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/usePagination.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { getGlobalOptions, GLOBAL_OPTIONS_PROVIDE_KEY } from './core/config';
55
import type {
66
GlobalOptions,
77
Options,
8+
PluginImplementType,
89
QueryResult,
910
Service,
1011
} from './core/types';
@@ -40,6 +41,7 @@ export interface PaginationQueryResult<R, P extends unknown[]>
4041
function usePagination<R, P extends unknown[] = any>(
4142
service: Service<R, P>,
4243
options: PaginationOptions<R, P> = {},
44+
plugins?: PluginImplementType<R, P>[],
4345
): PaginationQueryResult<R, P> {
4446
const defaultPaginationOptions = {
4547
currentKey: 'current',
@@ -77,6 +79,7 @@ function usePagination<R, P extends unknown[] = any>(
7779
const { data, params, run, ...rest } = useRequest<R, P>(
7880
service,
7981
finallyOptions,
82+
plugins,
8083
);
8184

8285
const paging = (paginationParams: Record<string, number>) => {

0 commit comments

Comments
 (0)