You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
804 B

"use strict";
exports.__esModule = true;
exports.default = createWebStorage;
var _getStorage = _interopRequireDefault(require("./getStorage"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function createWebStorage(type) {
var storage = (0, _getStorage.default)(type);
return {
getItem: function getItem(key) {
return new Promise(function (resolve, reject) {
resolve(storage.getItem(key));
});
},
setItem: function setItem(key, item) {
return new Promise(function (resolve, reject) {
resolve(storage.setItem(key, item));
});
},
removeItem: function removeItem(key) {
return new Promise(function (resolve, reject) {
resolve(storage.removeItem(key));
});
}
};
}