mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2024-12-28 09:49:10 +00:00
17 lines
343 B
JavaScript
17 lines
343 B
JavaScript
|
module.exports = {saveToLocal, getFromLocal, removeFromLocal, clearLocal};
|
||
|
|
||
|
function saveToLocal (k, v) {
|
||
|
window.localStorage.setItem(k, v);
|
||
|
}
|
||
|
|
||
|
function getFromLocal (k) {
|
||
|
return window.localStorage.getItem(k);
|
||
|
}
|
||
|
|
||
|
function removeFromLocal (k) {
|
||
|
window.localStorage.removeItem(k);
|
||
|
}
|
||
|
|
||
|
function clearLocal () {
|
||
|
window.localStorage.clear();
|
||
|
}
|