@jswork/next-activeable-data-list

1.0.0 • Public • Published

next-activeable-data-list

Next data list with active index.

version license size download

installation

npm install -S @jswork/next-activeable-data-list

apis

api params description
get - Get current active item.
to - Go to the input index.
next - Go to next index.
prev - Go to previous index.
first - Go to first index.
last - Go to last index.

options

{ activeIndex: 0, continuous: false }

usage

import NxActiveableDataList from '@jswork/next-activeable-data-list';

const items = [
  "item1",
  "item2",
  "item3",
  "item4",
  "item5",
  "item6",
  "item7",
  "item8",
  "item9",
];

const list = new NxActiveableDataList();

list.next();    // 1
list.next();    // 2
list.prev();    // 1
list.prev();    // 0

license

Code released under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i @jswork/next-activeable-data-list

Homepage

js.work

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

7.33 kB

Total Files

5

Last publish

Collaborators

  • afeiship