@ricardomatias/ring
Version:
Your average array made cyclical by using Proxy
36 lines (21 loc) • 818 B
Markdown
Your average array made cyclical by using [`Proxy`](https://kangax.github.io/compat-table/es6/#test-Proxy)
```js
import ring from '@ricardomatias/ring';
const AM7 = [ 'A', 'C', 'E', 'G' ];
const am7 = ring(AM7);
const first = am7[0]; // 'A'
const firstAgain = am7[4]; // 'A'
const firstYetAgain = am7[-4]; // 'A'
AM7 === am7 // => false
```
Use [npm](https://npmjs.com/) to install.
```sh
npm install @ricardomatias/ring --save
```
Returns a new *proxied* array. Provides access to all the native `Array` methods and properties.
MIT, see [LICENSE.md](http://github.com/ricardomatias/ring/blob/master/LICENSE.md) for details.