Skip to main content

Pages

An object that behaves identically to the Pages instance.

Constructor​

local pages = Pages.new(array content[, int pageSize[, function callback]])

Parameters​

TypeNameDefaultDescription
arraycontentThe content to pagify.
intpageSize0The maximum number of elements in each page. If 0 or nil, all contents will be in the first page.
functioncallbacknilThe function to run when calling AdvanceToNextPageAsync

Properties​

TypeNameDescription
boolIsFinishedWhether or not the last page has been reached.

Functions​

Return TypeSignatureDescription
voidAdvanceToNextPageAsync()Move to the next page in the sequence.
arrayGetCurrentPage()Get the contents of the current page.

AdvanceToNextPageAsync​

Moves to the next page in the sequence. The provided callback, if any, will be run before returning. If the final page has already been reached, this will throw an error.

GetCurrentPage​

Returns the contents of the current page.