Irev-Dev / MRI-Volume-Slice

Tools for view MRI Volumes in the browser
6 stars 7 forks source link

Store MRI data in IndexedDB #30

Closed ismaeldcom closed 6 years ago

ismaeldcom commented 6 years ago

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.

mkeeneth commented 6 years ago

That's great @ismaeldcom, I forgot all about IndexedDB and idb-keyval looks like a nice small lib.

Irev-Dev commented 6 years ago

@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.

mkeeneth commented 6 years ago

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

Irev-Dev commented 6 years ago

@mkeeneth Yeah make sense!