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.
21 lines
600 B
21 lines
600 B
import getStorage from './getStorage'; |
|
export default function createWebStorage(type) { |
|
var storage = getStorage(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)); |
|
}); |
|
} |
|
}; |
|
} |