2.0.0 • Published 10 years ago

evented-array v2.0.0

Weekly downloads
1
License
unlicense
Repository
github
Last release
10 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

10 years ago

1.0.1

10 years ago

1.0.0

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

12 years ago