JSFiddle - React, Tailwind, and code Playground

by Sahin Deniz

HTML

<script src="https://rawgit.com/localForage/localForage/master/dist/localforage.js"></script>
Open the console to see the output of this example.

JavaScript

const db = localforage.createInstance({
  driver: localforage.INDEXEDDB,
  name: 'testing',
});

db.setItem('somekey', ['#60d399', '#435fee'], function(err, value) {
  // Do other things once the value has been saved.
  console.log(value);
  db.getItem('somekey', function(err, value) {
    console.log('we just read ', value);
    console.dir(value);
    console.log("type: ", typeof value);
  });
});