drfaustusfade / ngm-reportDesk

The workdesk for ReportHub
0 stars 1 forks source link

migrate to localforage #10

Closed drfaustusfade closed 3 years ago

drfaustusfade commented 3 years ago

Use localforage (indexdb) as db for lists to overcome 5 MB local storage limit

https://github.com/drfaustusfade/ngm-reportHub/pull/37

drfaustusfade commented 3 years ago

@fakhrihawari could you please also test this out cluster lists (or other heavy lists) will be stored on async browser db, with localforage, that implementation is still using virtual ngmLists data service, but with an underlying store with localforage that is pulled on browser reload, added service ngmLocalDBLists.loadLists ( update: ) also updated on DEV for check

fakhrihawari commented 3 years ago

For now the 'lists' data and 'organization'data store in browser db perfectly For this what scenario i should use to test it further?

drfaustusfade commented 3 years ago

alright, thank you, just to double-check that everything is fine

drfaustusfade commented 3 years ago

main functionality summary: on each reload ngmLocalDB loadVirtualDB service will run load data into ngmLists from localdb, ngmLocalDB.isVirtualDBLoaded promise could be used to route resolve ngmClusterLists.areListsFetched function can be used to get promise for route resolve, or ngmClusterLists.areListsLoading function to check if list loading flag is on ngmLocalDB is wrapper service for localforage ngmLocalDBLists is module facade for ngmLocalDB if specific functionality for a module is needed ngmLocalDB functions could have virtual, fetch flags to indicate is ngmLists should be set and if data should be returned with bind it is possible to set to scope with loadItem to load into ngmLists if not on it also setItem, getItem, removeItem, keys, clear all functions return promises

drfaustusfade commented 3 years ago

updated DEV and PROD