localforage-driver-memory
Version:
in-memory localforage driver that resets on page reload
13 lines • 562 B
JavaScript
import { executeCallback, normaliseKey } from 'localforage-driver-commons';
export function getItem(key$, callback) {
var _this = this;
key$ = normaliseKey(key$);
var promise = this.ready().then(function () {
var result = _this._dbInfo.mStore.get(key$);
// Deserialise if the result is not null or undefined
return result == null ? null : _this._dbInfo.serializer.deserialize(result); //tslint:disable-line:triple-equals
});
executeCallback(promise, callback);
return promise;
}
//# sourceMappingURL=getItem.js.map