Closed ismaeldcom closed 6 years ago
That's great @ismaeldcom, I forgot all about IndexedDB and idb-keyval looks like a nice small lib.
@ismaeldcom @mkeeneth Really glad you two agree. Both solutions work beautifully in my browser. Do you guys think there is any merit merging both? that would make Mkeeneth's solution a fall back, or is that silly since browser support is better for IndexedDB?
BTW, I'm super Impressed you were able to do this in four lines.
You can certainly use both approaches together. That is a typical approach used by PWA's.
https://developers.google.com/web/fundamentals/instant-and-offline/web-storage/offline-for-pwa
@mkeeneth Yeah make sense!
28 A simple solution for MRI data store and recover, just 4 lines and <1KB dependency.
Use of Local Storage is possible if data was smaller, for this purpose I think IndexedDB is the best solution allowing to save up to 50MB without any confirmation and with more browser support than alternative solution provided by @mkeeneth in #29, a very good solution when more browser support it by the way.