I am very new to angular. I am trying to build a small app which shows scores of 3 teams on a page.
So I have an API which returns score of a team based on the ID we pass
But my confusion is how to achieve it the best way??
Do I need to create a function which calls the API in an interval
Then I thought if I add a 5 second interval, if there is multiple score changes in that 5 seconds we miss one, isnt it?
Also when due to heavy traffic or hit to the server and if one request take more than 5 second, then the next interval fires which could ends up calling the same before the previous one finishes.
So how can I make it the best way. I am working in Angular 10
See Question&Answers more detail:os