1.1.0 • Published 9 years ago

rotary-array v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Rotary

build status js-standard-style

Rotary is a simple helper to rotate an ordered collection of data. I use this technique most often with sliders and don't want to rewrite this every single time.

Installation

$ npm install rotary-array
$ npm install marcusandre/rotary

Usage

var Rotary = require('rotary')
var r = Rotary([1, 2, 3])
r.next() // 2, 3, 1
r.previous() // 1, 2, 3

Todo

  • fn.get(num) to rotate until num is first item

Test & Coverage

$ make test
$ make coverage

License

MIT

1.1.0

9 years ago