src/statorgfc.js
function(key) {
    if (!store._store_created) {
      throw 'cannot get store because is has not been created'
    }
    if (arguments.length === 0) {
      // return the whole store
      if (store.options.immutable) {
        return Object.assign({}, store._store) // copy entire store by value
      } else {
        return store._store // return reference to store
      }
    } else if (arguments.length > 1) {
      console.error('unexpected number of arguments')
      return
    }

    if (!store._store.hasOwnProperty(key)) {
      throw `attempted to access key that was not set during initialization: ${key}`
    }

    let ref = store._store[key]
    if (store.options.immutable) {
      return copyByValue(ref)
    } else {
      // return the reference
      return ref
    }
  }
function(key) {
    if (!store._store_created) {
      throw 'cannot get store because is has not been created'
    }
    if (arguments.length === 0) {
      // return the whole store
      if (store.options.immutable) {
        return Object.assign({}, store._store) // copy entire store by value
      } else {
        return store._store // return reference to store
      }
    } else if (arguments.length > 1) {
      console.error('unexpected number of arguments')
      return
    }

    if (!store._store.hasOwnProperty(key)) {
      throw `attempted to access key that was not set during initialization: ${key}`
    }

    let ref = store._store[key]
    if (store.options.immutable) {
      return copyByValue(ref)
    } else {
      // return the reference
      return ref
    }
  }
function ( key ) { if ( ! store . _store_created ) { throw 'cannot get store because is has not been created' } if ( arguments . length === 0 ) { // return the whole store if ( store . options . immutable ) { return Object . assign ( { } , store . _store ) // copy entire store by value } else { return store . _store // return reference to store } } else if ( arguments . length > 1 ) { console . error ( 'unexpected number of arguments' ) return } if ( ! store . _store . hasOwnProperty ( key ) ) { throw ` ${ key } ` } let ref = store . _store [ key ] if ( store . options . immutable ) { return copyByValue ( ref ) } else { // return the reference return ref } }
Get reference or value to one of the keys in the current store.
@param key of the store object to get a reference to
@return reference or new object (depending on `immutable` option)
NOTE: The store should *only* be update by calling `store.set(...)`
Throws error if key does not exist in store.
Get reference or value to one of the keys in the current store .