Data collection with a change event.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
index.js
package.json
spec.js

README.md

Arrr

Data collection for objects with a change event when stuff gets pushed to it.

var arrr = require('arrr');

// First param of arrr is the base array for storing the data. 
// Second param is the id to find, remove, update objects.

var collection = arrr([], 'id');

collection.add({ id: '1234', name: 'foo' }); // id is unique objects with the same id wont be added
collection.find('1234');
collection.all();
collection.update({ id: '1234', name: 'bar' }); // will insert if id isn't found
collection.remove('1234');
collection.clear(); // remove everything