JSFiddle - React, Tailwind, and code Playground

by Drath

HTML

<script src="http://cdnjs.cloudflare.com/ajax/libs/idbwrapper/1.4.1/idbstore.min.js"></script>

JavaScript

//Test data
var testData = {
    test: [199, 2, 3],
    test2: 'test',
    test3: undefined,
    test4: 123,
    test5: []
}

for(var i = 0; i < 50000; i++) {
    testData.test5[i] = { thing: 2938982001894928.232881232, thing2: "test", thing3: false };
}

      var idb = new IDBStore({
        dbVersion: 1.0,
        storeName: 'Wayward3',
        keyPath: null,
        autoIncrement: false
      });

window.onbeforeunload = function () {
    //Save IDB
    idb.put('test1', testData);
    idb.put('test2', testData);
};