function Store(name, callback) {
  callback = callback || function() {
  }

  this._dbName = name

  if (!localStorageMemory[name]) {
    var data = {
      todos: []
    }

    localStorageMemory[name] = JSON.stringify(data)
  }

  callback.call(this, JSON.parse(localStorageMemory[name]))
  this.subscribers = []
}
/**
 * Creates a new client side storage object and will create an empty
 * collection if no collection already exists.
 *
 * @param {string} name The name of our DB we want to use
 * @param {function} callback Our fake DB uses callbacks because in
 * real life you probably would be making AJAX calls
 */
Creates a new client side storage object and will create an empty
collection if no collection already exists.

@param {string} name The name of our DB we want to use
@param {function} callback Our fake DB uses callbacks because in
real life you probably would be making AJAX calls
Creates a new client side storage object and will create an empty collection if no collection already exists . @param { string } name The name of our DB we want to use @param { function } callback Our fake DB uses callbacks because in real life you probably would be making AJAX calls
function Store(name, callback) {
  callback = callback || function() {
  }
  this._dbName = name
  if (!localStorageMemory[name]) {
    var data = {
      todos: []
    }
    localStorageMemory[name] = JSON.stringify(data)
  }
  callback.call(this, JSON.parse(localStorageMemory[name]))
  this.subscribers = []
}
function Store ( name , callback ) { callback = callback || function ( ) { } this . _dbName = name if ( ! localStorageMemory [ name ] ) { var data = { todos : [ ] } localStorageMemory [ name ] = JSON . stringify ( data ) } callback . call ( this , JSON . parse ( localStorageMemory [ name ] ) ) this . subscribers = [ ] }
Creates a new client side storage object and will create an empty
 collection if no collection already exists.
Creates a new client side storage object and will create an empty collection if no collection already exists .