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.
22 lines
427 B
22 lines
427 B
'use strict'
|
|
|
|
/**
|
|
* This module serves as an Async wrapper for LocalStorage
|
|
*/
|
|
export function setItem (key, value) {
|
|
return new Promise((resolve) => {
|
|
localStorage.setItem(key, value)
|
|
resolve()
|
|
})
|
|
}
|
|
|
|
export function getItem (key) {
|
|
return Promise.resolve(localStorage.getItem(key))
|
|
}
|
|
|
|
export function removeItem (key) {
|
|
return new Promise((resolve) => {
|
|
localStorage.removeItem(key)
|
|
resolve()
|
|
})
|
|
}
|
|
|