I’m using a number of promises to perform various SQL transactions within my app. I am also using Angulars latest http library to perform http.get and http.post. These methods, however, return observables which use a different set of callbacks, than those provided with promises.
My question is, is it possible to wrap the http observables as promises. The reason I ask is because currently, at my apps first launch, I wish to
- Create tables (using promises)
- Fetch data (using observables)
- Write data to db (using promises)
- Return a status when all of this is finished.
If step 2 returned a promise, I could simply use the .then() syntax to order these asyncronous tasks, however, since task 2 returns an observable, I am unsure how to maintain order between the promises and observables.
Has anyone else faced this issue, or know of a solution?