Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PaginatedCachedAsyncHookContract<T>

Paginated cached async hook

Extends the return type defined by CachedAsyncHookContract

Defines the result of a paginated response. This can be used just like the regular CachedAsyncHookContract. It exposes an additional property called pagination that contains the pagination metadata: PaginationMeta.

Note that if no pagination params is specified in the fetcher hook, e.g. useEvents, the resulting data will use the default page amount {@link DEFAULT_PAGINATION_AMOUNT}.

Type parameters

Hierarchy

Index

Properties

Optional data

data: T

Optional error

error: ApiError | Error

isValidating

isValidating: boolean

mutate

mutate: (data?: T | Promise<T>, shouldRevalidate?: boolean) => Promise<undefined | T>

Type declaration

    • (data?: T | Promise<T>, shouldRevalidate?: boolean): Promise<undefined | T>
    • Parameters

      • Optional data: T | Promise<T>
      • Optional shouldRevalidate: boolean

      Returns Promise<undefined | T>

Optional pagination

pagination: PaginationMeta

Optional setSize

setSize: (size: number) => void

Type declaration

    • (size: number): void
    • Parameters

      • size: number

      Returns void

size

size: number

Generated using TypeDoc