Problem function to wait all is over

I have a login page when start need to download some master data from save to a sqllite Database
and then read the data store.

I have two functions DownloadData() and ReadData()

constructor(public toastCtrl: ToastController,private nav: NavController,public http: Http,private sqlite: SQLite, private auth: AuthmermaService, private alertCtrl: AlertController, private loadingCtrl: LoadingController) {

this. DownloadData();
this. ReadData();


I need to do the first function wait to all download and store in a sqllite database finish and then the second.

But httpPost is async and sqllite execute too so i dont have how to manage this.

Hope u can help me

I would urge you to rethink hard whether this is really true - I suspect it is more a matter of convenience than need, as the user should logically be able to interact with the data as soon as it’s available to the app - I doubt it’s really necessary to make the user wait for the SQLite write.

That being said, look into the RxJS concat operator.

thanks, i will check that