getItem.js 562 B

12345678910111213
  1. import { executeCallback, normaliseKey } from 'localforage-driver-commons';
  2. export function getItem(key$, callback) {
  3. var _this = this;
  4. key$ = normaliseKey(key$);
  5. var promise = this.ready().then(function () {
  6. var result = _this._dbInfo.mStore.get(key$);
  7. // Deserialise if the result is not null or undefined
  8. return result == null ? null : _this._dbInfo.serializer.deserialize(result); //tslint:disable-line:triple-equals
  9. });
  10. executeCallback(promise, callback);
  11. return promise;
  12. }
  13. //# sourceMappingURL=getItem.js.map