constisEmpty = async (): Promise<void> => { if (!assetsReady) { constc = awaitdatabase.assets.count() if (c === 0) { // set forceHTTP to true to ensure data is retrieved from the API (not from cache (which will be empty (which is loop badness))) constassets = awaitgetAssets(true) awaitdatabase.assets.bulkPut(assets) } assetsReady = true } }
An interface for a repository of Assets.
Provide your own cache implementation to avoid HTTP requests.
Example
The following example shows how to use a custom cache implementation to avoid HTTP requests using the Dexie indexeddb wrapper.
Dependencies
assetRepository.ts