angular load data in component only when indexedDb table is populated

In my service I have this: synchronizeCitiesOnLogin() { …. this.getCitiesFromApi().subscribe( cities => { cities.map((city) => { this.addCityToIndexedDb(city); }); } ); } getCitiesFromApi() { …. return this.apiClient.get(url, { }) .pipe( map((response: any) => response.data ), catchError(errorRes => { return throwError(errorRes); }) ); } addCitiesToIndexedDb(city) { this.cityTable .add(city) .then(async () => { const allItems: CityModel[] = await […]

By godzo101
Published
Categorized as angular, indexeddb, javascript Tagged , ,

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq