19 lines
480 B
JavaScript
Raw Normal View History

2018-07-03 15:47:15 -04:00
import localForage from "localforage";
function localForageTest() {
const testKey = 'localForageTest';
localForage.setItem(testKey, {expires: Date.now() + 300000}).then(() => {
localForage.removeItem(testKey);
}).catch((err) => {
if (err.code === 22) {
const message = `Unable to set localStorage key. Quota exceeded! Full disk?`;
return alert(`${message}\n\n${err}`);
}
console.log(err);
})
}
localForageTest();
export default localForage;