JBassil
JBassil

Reputation: 11

React Native realtime get data

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

Answers (1)

user926721
user926721

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

Related Questions