You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you recommend using another 3rd party library (like idb, dexie) or should I try to use the indexedDB API directly?
I prefer to use direct API. Many npm tools are suffer from bad design which lead to JS bundle size bloat.
If I wanted to use IndexedDB instead of localStorage, would it be better to use it directly without going through nanostores/persistent?
I think that localStorage and IndexedDB should be used for different purposes. Don’t change the engine because of the trends. Settings are still better to put to localStorage.
IndexedDB is good for long lists (like 1-10 MB of data). nanostores/persistent API was created to work with small settings, not with long lists of data. It will be better to add another stores with different API.
For instance, there is SyncMap stores in @logux/client which uses Nano Stores and IndexedDB (to put events list there, so it is a little more complicated that you may look for).
If I were to move ahead with using IndexedDB as the persistent engine, how should I approach the async nature of it?
You will need some key to mark that store is loading. For instance, SyncMap has if (value.isLoading) { renderLoader() } else { renderUI() }.
I am closing this issue since it is more like a question.
Through reading the documentation I saw a section on Persistent Engines and switching
localStorage
out for other engines.However, I am not sure of how to approach this.
idb
,dexie
) or should I try to use the indexedDB API directly?localStorage
, would it be better to use it directly without going throughnanostores/persistent
?The text was updated successfully, but these errors were encountered: