github.com/easysoft/zendata@v0.0.0-20240513203326-705bd5a7fd67/ui/src/utils/localCache.js (about) 1 import localforage from 'localforage'; 2 3 export const getCache = async (key) => { 4 return await localforage.getItem(key); 5 }; 6 7 export const setCache = async (key, val) => { 8 try { 9 await localforage.setItem(key, val); 10 return true; 11 } catch (error) { 12 return false; 13 } 14 };