As someone that just started using Angular a couple of months ago, my biggest block has been wrapping my head around Observables and Promises. Specifically, when several APIs calls are dependent upon the data returned from several other api calls.
I now understand the basics of promise chaining and forkJoin, but it all feels so messy that I can't help but think there are better ways to achieve my desired results.
The problem is, all of the online examples and tutorials either never call an API, instead mocking a data return, or they return data into a component or service global variable rather than immediately using the returned value (or promise of a returned value) in another api call.
I’m an Italian web and mobile engineer. I have a passion for creating and enhancing anything technology related. When it comes to building, my ultimate goal is to make the world a better place.
Location
Chiasso, Switzerland
Education
DEGREE IN COMPUTER SCIENCE ENGINEERING
Work
Entrepreneur, Senior Front End Developer, Blogger, Speaker at Dreaming Lab Sagl
As someone that just started using Angular a couple of months ago, my biggest block has been wrapping my head around Observables and Promises. Specifically, when several APIs calls are dependent upon the data returned from several other api calls.
I now understand the basics of promise chaining and forkJoin, but it all feels so messy that I can't help but think there are better ways to achieve my desired results.
The problem is, all of the online examples and tutorials either never call an API, instead mocking a data return, or they return data into a component or service global variable rather than immediately using the returned value (or promise of a returned value) in another api call.
This has made learning painful.
Do you have any specific scenario for that? I would like to try to help you with some practical examples (I even could write an article :) )
Give me a few days and I'll come up with an example that can be shared. I would *love*to know the best way to code it.
Thank you!
Four months into angular and I am finally wrapping my head around rxjs. I feel your pain.