Takes a list and cycles through them.

This is good for showing a single item on the UI and letting user cycle through then with a click of a button.

Type Parameters

  • T

Constructors

Properties

change: EventEmitter<T | T[]> = ...

Event that is triggered when current item changes. Or page changes in case of multi.

hasNext: boolean = false

Whether there is a next item or page or not.

hasPrev: boolean = false

Whether there is a next item or page or not.

index: number = 0

Current item or page (in case of multi) index.

item?: T

Current item (in case of non-multi).

items: T[]

List of items

page?: T[]

Current page (in case of multi).

pages?: T[][]

List of pages of list of items per page. Used in case of multi.

Methods

  • Generate list of pages of items based on per page.

    Returns void

    • ListItemCycle.perPage
    • ListItemCycle.pages
    • ListItemCycle.page
  • To change the value of perPage call this method. It validates the value and regenerates pages as well.

    Parameters

    • value: number

    Returns boolean