const arr = [];
arr.push(item)
window.Indexeddb.open(....)
// save to idb manually
// later, retrieve from idb manually on next session
we should be able to do
const fancyArr = createFancyArr({ ownerId: 'arr-123' })
fancyArr.push(item) // or insert(item) for sorted
fancyArr.length // normal in-memory array length
fancyArr.length_total // length of all items under 'arr-123'
and now any 'arr-123' items from previous session will load to fancyArr in batches (first batch loads immediately)
already implemented a simple proxy to trigger 'retrieve-next-batch' before reaching the end of loaded items
There is still the tricky part where arr can be used normally like 'arr.map(item=> <ItemComponent {...item} />)' while only loading subsequent batches on that new array index access
idk what to do there, maybe will intercept iterator methods and return another proxied array, maybe
quotingspent two weeks on this IndexedDB array visualizer
nevent1q…r2nq
it should do with data in IndexedDB what UI visualizers such as Virtua do with dom elements
it provides a normal array of items where more retrieves are triggered dynamically upon access thus guarantees zero bulk retrievals
I hope it test well
![]()
