mostly garbage
This commit is contained in:
parent
575db85477
commit
ecf54f400b
39 changed files with 1120 additions and 1166 deletions
ui/js
|
@ -12,4 +12,20 @@ export function getLocal(key) {
|
|||
*/
|
||||
export function setLocal(key, value) {
|
||||
localStorage.setItem(key, JSON.stringify(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Thin wrapper around localStorage.getItem(). Parses JSON and returns undefined if the value
|
||||
* is not set yet.
|
||||
*/
|
||||
export function getSession(key) {
|
||||
const itemRaw = sessionStorage.getItem(key);
|
||||
return itemRaw === null ? undefined : JSON.parse(itemRaw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Thin wrapper around localStorage.setItem(). Converts value to JSON.
|
||||
*/
|
||||
export function setSession(key, value) {
|
||||
sessionStorage.setItem(key, JSON.stringify(value));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue