They just replace the page content with the image so when you hit back you are navigated back to HN or in your case nowhere since you opened it in a new tab.
It's good to to see IndexDB used for data persistence to reduce the need for a backend API and network calls. It's an under-used technology that's available in every browser (https://caniuse.com/indexeddb).
I can recommend Dexie (https://dexie.org/) as a wrapper to make it a bit nicer to work with.
what makes this application better suited to IndexedDB over localstorage? its not a lot of data.
I haven't found IndexedDB helps much the quantity of data (you can store more than localStorage, but most apps don't need close to that much). The advantage comes from iterating over the data (with cursors) for searching, and the fact that Indexeddb is versioned so you can migrate existing data to a new format when you deploy updates really easily.
7 comments
[ 3.4 ms ] story [ 33.7 ms ] threadI can recommend Dexie (https://dexie.org/) as a wrapper to make it a bit nicer to work with.
(genuine qtn, i tend to use localstorage a lot and have never handcoded IDB usage but have of course used libraries that used IDB)
I haven't found IndexedDB helps much the quantity of data (you can store more than localStorage, but most apps don't need close to that much). The advantage comes from iterating over the data (with cursors) for searching, and the fact that Indexeddb is versioned so you can migrate existing data to a new format when you deploy updates really easily.