lib/storage/localstorage.js
function LocalStorage (opts) {
  if (!isLocalStorageSupported()) {
    console.warn('localStorage not supported! (data will be stored in memory)')
  }

  var self = this
  Storage.call(self, opts)

  opts = _.extend({
    keyName: 'blockchainjs_' + self.networkName
  }, opts)

  if (!this.compactMode) {
    throw new errors.Storage.FullMode.NotSupported()
  }

  self._storage = getStorage()
  self._keyName = opts.keyName

  // load this._data
  Promise.try(function () {
    self._init()
    self._save()
  })
  .then(function () { self.emit('ready') })
  .catch(function (err) { self.emit('error', err) })
}
function LocalStorage (opts) {
  if (!isLocalStorageSupported()) {
    console.warn('localStorage not supported! (data will be stored in memory)')
  }

  var self = this
  Storage.call(self, opts)

  opts = _.extend({
    keyName: 'blockchainjs_' + self.networkName
  }, opts)

  if (!this.compactMode) {
    throw new errors.Storage.FullMode.NotSupported()
  }

  self._storage = getStorage()
  self._keyName = opts.keyName

  // load this._data
  Promise.try(function () {
    self._init()
    self._save()
  })
  .then(function () { self.emit('ready') })
  .catch(function (err) { self.emit('error', err) })
}
function LocalStorage ( opts ) { if ( ! isLocalStorageSupported ( ) ) { console . warn ( 'localStorage not supported! (data will be stored in memory)' ) } var self = this Storage . call ( self , opts ) opts = _ . extend ( { keyName : 'blockchainjs_' + self . networkName } , opts ) if ( ! this . compactMode ) { throw new errors . Storage . FullMode . NotSupported ( ) } self . _storage = getStorage ( ) self . _keyName = opts . keyName // load this._data Promise . try ( function ( ) { self . _init ( ) self . _save ( ) } ) . then ( function ( ) { self . emit ( 'ready' ) } ) . catch ( function ( err ) { self . emit ( 'error' , err ) } ) }
Only compactMode supported

@class LocalStorage
@extends Storage

@param {Object} [opts]
@param {string} [opts.networkName=livenet]
@param {boolean} [opts.compactMode=false]
@param {string} [opts.keyName] Recommended for use with network name
Only compactMode supported