cycle-chunk
v0.0.1
Published
Cycle through an array indefinetly providing a chunk of custom size per iteration. Usefull in showing slideshows, panels, tabs and so forth.
Downloads
1
Readme
cycle-chunk
Cycle through an array indefinetly providing a chunk of custom size per iteration. Usefull in showing slideshows, panels, tabs and so forth.
Install:
npm i cycle-chunk
Example:
import CycleChunk from 'cycle-chunk'
const cyclechunk = new CycleChunk([1,2,3,4,5,6,7], 3)
cyclechunk.next() == [1,2,3]
cyclechunk.next() == [4,5,6]
cyclechunk.next() == [7,1,2]
cyclechunk.prev() == [4,5,6])
cyclechunk.prev() == [1,2,3])
cyclechunk.prev() == [5,6,7])