evented-array

Array emitting mutator events

Showing:

Popularity

Downloads/wk

0

GitHub Stars

2

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

1

License

Unlicense

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial