2.0.0 • Published 8 years ago

evented-array v2.0.0

Weekly downloads
1
License
unlicense
Repository
github
Last release
8 years ago

Evented array Build Status Code Climate

Just tiny wrapper to make any array emit mutator events.

Use

$ npm install evented-array

var EventedArray = require('evented-array');

var a = new EventedArray(1,2,3);
var b = EventedArray([]);

a.on('shift', function () { console.log('Shifted'); });
b.on('changed', function () { console.log('Changed'); });

a.shift();
b.push(3);

Full list of mutator methods can be found in MDN mutator methods list:

  • copyWithin
  • fill
  • pop
  • push
  • reverse
  • shift
  • sort
  • splice
  • unshift

To subclass Array is used the Irakli Gozalishvili’s method.

NPM

2.0.0

8 years ago

1.0.1

8 years ago

1.0.0

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

10 years ago