score:3

Accepted answer

Sockets are probably the most straightforward answer. Have a look at socket.io, they make it quite easy to implement exactly what you're looking for.

Here is an example of building a redux-react app with sockets: https://medium.com/@gethylgeorge/using-socket-io-in-react-redux-app-to-handle-real-time-data-c0e734297795, including a git repo: https://github.com/Gethyl/RealTimeTodo. They might use node.js for the backend, but socket.io is backend agnostic.

You just connect store to your sockets when your component loads. Here is the relevant snippet from the example repo: https://github.com/Gethyl/RealTimeTodo/blob/f6c19b175977127c4a542882c75b76836b4a5ba4/src/js/components/Layout.js#L41


Related Query

More Query from same tag