Type of the items.
Type of the items.
Resolves the payload into the total count.
Initial page size, a positive integer.
OptionalitemsPerPageOptions: List<number>
Allowed page sizes; itemsPerPage must be one of them.
Optionaloptions: PaginationExtensionOptions<TItem>
Protected Readonly_Protected_Bus used to register handlers and to raise the events.
Protected_Protected Optional Readonly_Protected_Protected Readonly_Protected Readonly_Protected_Protected_true when page is not the last one.
true when page is not the first one.
Size of a page, a positive integer.
Allowed values of itemsPerPage, when restricted.
Number of pages, at least 1: ceil(totalItemsCount / itemsPerPage).
Current page, from 1 to lastPage.
Total count of the last read, 0 before the first.
Protected_Schedules the *Change event after the quiet time, restarting the wait
if one is already pending.
Protected_Raises the *Change event of the extension.
Reads the total count, forwarding the signal of the read to the count reader, then adds the pagination. Nothing is updated when the read was superseded while the count was pending.
Optionalsignal: AbortSignalCancels the pending *Change event and removes every handler.
Goes to page 1.
Goes to lastPage.
Goes to the next page, staying on the last one if already there.
Goes to a page. Raises page only when the (clamped) target differs from
the current page.
Target page, truncated to an integer and clamped to [1, lastPage].
Goes to the previous page, staying on the first one if already there.
Registers a handler for an event.
Name of the event to listen to.
Event to subscribe to.
Callback invoked every time event is raised.
a subscription; dispose it to remove this single handler.
Changes the page size, then clamps the current page to the new
lastPage (raising page if it changes).
Positive integer, one of itemsPerPageOptions when they are set; otherwise an error is thrown.
Reads the total count with its own reader on every read, then adds the Pagination to the payload. Place it after the extensions whose contribution the count must consider (filters above all). The count reader receives the signal of the read, so it can hand it to
fetch. By default it goes back to the first page when the query built by the previous extensions changes between two reads (PaginationExtensionOptions.resetPageOnQueryChange).Example