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:
@@ -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);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user