22 lines
497 B
TypeScript
Raw Normal View History

import localForage from 'localforage';
2018-07-03 15:47:15 -04:00
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?';
console.warn(message);
}
console.log(err);
});
2018-07-03 15:47:15 -04:00
}
localForageTest();
export default localForage;