src/index.js
function get (key, def) {
  if (Array.isArray(key)) {
    return AsyncStorage.multiGet(key)
      .then((values) => values.map(([_, value]) => {
        return useDefault(def, value) ? def : parse(value)
      }))
      .then(results => Promise.all(results))
  }

  return AsyncStorage.getItem(key).then(value => useDefault(def, value) ? def : parse(value))
}
function get (key, def) {
  if (Array.isArray(key)) {
    return AsyncStorage.multiGet(key)
      .then((values) => values.map(([_, value]) => {
        return useDefault(def, value) ? def : parse(value)
      }))
      .then(results => Promise.all(results))
  }

  return AsyncStorage.getItem(key).then(value => useDefault(def, value) ? def : parse(value))
}
function get ( key , def ) { if ( Array . isArray ( key ) ) { return AsyncStorage . multiGet ( key ) . then ( ( values ) => values . map ( ( [ _ , value ] ) => { return useDefault ( def , value ) ? def : parse ( value ) } ) ) . then ( results => Promise . all ( results ) ) } return AsyncStorage . getItem ( key ) . then ( value => useDefault ( def , value ) ? def : parse ( value ) ) }
Retreive value from AsyncStorage based on key.
Wrapper around getItem & multiGet.

@param {String, Array} key Key to lookup
@param {Any} def Default value

@returns {Promise} value of key

@example
storage.get('foo').then(console.log).catch(console.error)
Retreive value from AsyncStorage based on key . Wrapper around getItem & multiGet .