1. Module bundling added to reduce server calls as each file was taking ~440 ms to load on public server.\n2. JavaScript lib files refactored with OOP for use with module bundling.

This commit is contained in:
2024-09-10 19:43:02 +01:00
parent aac01e687f
commit 0c88f161c3
7678 changed files with 778712 additions and 1254 deletions

View File

@@ -1,5 +1,7 @@
// Local storage
import Validation from "./validation";
export default class LocalStorage {
/*
function getPageLocalStorage(pageHash) {
@@ -10,7 +12,7 @@ function getPageLocalStorage(pageHash) {
}
if (isEmpty(ls)) return {}
if (Validation.isEmpty(ls)) return {}
return ls;
}
@@ -32,19 +34,19 @@ function setupPageLocalStorage(pageHash) {
let ls = getPageLocalStorage(pageHash);
if (isEmpty(ls)) ls = {};
if (Validation.isEmpty(ls)) ls = {};
setPageLocalStorage(pageHash, ls);
}
*/
function getLocalStorage(key) {
return JSON.parse(localStorage.getItem(key));
}
static getLocalStorage(key) {
return JSON.parse(localStorage.getItem(key));
}
function setLocalStorage(key, newLS) {
localStorage.setItem(key, JSON.stringify(newLS));
}
static setLocalStorage(key, newLS) {
localStorage.setItem(key, JSON.stringify(newLS));
}
/*
function setupPageLocalStorageNext(pageHashNext) {
@@ -56,4 +58,5 @@ function setupPageLocalStorageNext(pageHashNext) {
lsNew[keyBasket] = (keyBasket in lsOld) ? lsOld[keyBasket] : {'items': []};
setPageLocalStorage(hashPageCurrent, lsNew);
}
*/
*/
}