JSFiddle - React, Tailwind, and code Playground
by Roman Fedytskyi
HTML
<script src="https://rawgit.com/localForage/localForage/master/dist/localforage.js"></script>
Open the console to see the output of this example.
JavaScript
var store = localforage.createInstance({
name: "formStorage"
});
console.log(store);
store.setItem('form1', {
name: 'Name',
date: new Date()
}).then(function(value) {
console.log(value);
}).catch(function(err) {
console.log('ERR: ', err);
})
store.length().then(function(res) {
console.log(res);
});