evented-array

    2.0.0 • Public • Published

    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

    Install

    npm i evented-array

    DownloadsWeekly Downloads

    0

    Version

    2.0.0

    License

    unlicense

    Last publish

    Collaborators

    • dfcreative