Closed Anid4u2c closed 5 years ago
We don't have specific documentation about IndexedDB, but all of the related code is part of the favorites action creators (https://github.com/Polymer/pwa-starter-kit-hn/blob/master/src/actions/favorites.ts) since favorites are the only thing the app stores in IndexedDB. Basically these are all async redux-thunk actions that dispatch after database request success. The loadFavorites()
action is dispatched only when the app initially loads to populate the store with IndexedDB data (https://github.com/Polymer/pwa-starter-kit-hn/blob/8aec8286000b8729d3bdea7a6dbb8c8adf6ebb1e/src/components/hn-summary.ts).
Thanks @keanulee! Your comment provides all the info I need, basically a reference to the code where IndexedDB was called, and it helps to know when loadFavorites() is called. From all that I can tell that dbPromise
is used to add, remove, or save a favorite.
As per the PWA Starter Kit this sample app implements a "pattern for using indexedDB for local storage", yet the README file makes no mention of it.
Ultimately, I'm attempting to implement IndexedDb in my own apps, and would like a reference to it's implementation in this application sample, using Polymer 3.
Thanks!