DataStore Class

Simple data store used to manage records and broadcast updates

Constructors

DataStore( data )

Public Methods

addEventListener( name, fn, scope )
push( record )
add( record )
insert( record, idx )
Used to add a record at a specific index and pushes records below it down a level
pop( )
Removes and returns the last element from the data store
shift( )
Removes and returns the first element from the data store
remove( record )
Used to remove a record from the data store
removeAt( idx )
clear( )
splice( idx, numRecords )
get( idx )
set( idx, record )
sort( fn )
forEach( callback )
Used to iterate through all the records in the store using a callback function. Example:
      store.forEach(function (record, i) {
          console.log(i, record);
      });
    
Optional: return true in the callback function if you wish to break and iterate stop iterating.
destroy( )