i have a service PhoneService calling (in the constructor) a remote API to get data and populate DB, the AppComponent use the PhoneService (ngOnInit) to get data from Dexie table. in the first page load i have no data (it's normal because AppComponent call function to get data before the PhoneService populate Dexie DB)
my question is : how can i tell my PhoneService to wait unit pupulation ending and then fetch the Dexie table to get data ?
First page load : Check if Data in my Dexie Table (0 record) -> Calling API -> Populate Dexie DB -> fetch Dexie Table (No data because angular fetch Dexie table before, data population end )
Second+ page load : Check if Data in my Dexie Table (ok) -> fetch Dexie Table (OK)
thank you