Interface PaginatedOption<T, L, K>

interface PaginatedOption<T, L, K> {
    lastKey?: K;
    limit?: LimitFn<"total" | L, T>;
    onDone?: ((totalPage, key, data) => undefined | boolean);
    onNextPage?: ((currentPage, key, data) => unknown);
}

Type Parameters

Properties

lastKey?: K

上一页的 key

limit?: LimitFn<"total" | L, T>

Returns

true: 继续下一页;false: 停止获取

onDone?: ((totalPage, key, data) => undefined | boolean)

当结束时触发

Type declaration

    • (totalPage, key, data): undefined | boolean
    • Parameters

      • totalPage: number
      • key: undefined | K
      • data: T[]

      Returns undefined | boolean

Returns

false: 将停止获取下一页

onNextPage?: ((currentPage, key, data) => unknown)

当获取下一页时触发

Type declaration

    • (currentPage, key, data): unknown
    • Parameters

      • currentPage: number
      • key: undefined | K
      • data: T[]

      Returns unknown

Returns

false: 将停止获取下一页