Reputation: 11
Im trying to build a real time feed with react native and I have limited request to the api given.
How should I get the data realtime with using a lot of requests.
I used to do that:
setInterval(() => {this.getfeed()},1000);
Thanks
Upvotes: 1
Views: 111
Reputation:
You need to check if the API gives you information about the rate limits in its responses headers (e.g. X-RateLimit-Limit
, X-RateLimit-Remaining
). With this in mind, you can optimize your polling timing. Otherwise you need to figure the API limits yourself and poll accordingly.
Upvotes: 1