F
F
fronter-up2017-11-05 12:59:03
JavaScript
fronter-up, 2017-11-05 12:59:03

Communication with server every N seconds, react/redux?

Good afternoon! Please tell me how best to receive data if it is necessary that they come every N seconds (4-8)?
Now I'm running setInterval and every 5 seconds with new parameters it pulls the server, if something has changed the server sends data.
Is this approach correct?
Is webSocket suitable for this?
What are the alternatives
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya Gerasimov, 2017-11-05
@fronter-up

webSocket and let the server tell you if the data has changed

I
iBubnov, 2017-11-05
@iBubnov

You can use LongPolling
LongPolling

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question