H
H
HellYeahOmg2019-12-31 12:35:05
React
HellYeahOmg, 2019-12-31 12:35:05

How to sync status across devices?

Suppose the application has state A. By clicking on the button, it changes to state B. By default, state A.
How can I change the state on one device, log in from another and see the same picture?
You only need to use react and redux.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2019-12-31
@HellYeahOmg

without a backend server, this is real if you set up and support p2p communication between clients, but the problem is that you still have to start (when the number of users is less than a certain threshold, or rather, it is necessary that at any given time there are several users online, t .e. keeping your tab open or other technologies that allow your scripts to be active) to keep some service (or literally, keep a tab in the browser open) responsible for communication.
It is very difficult to do anything in this way, more precisely, it is necessary to implement a very complex network (the keywords for technologies are webrtc, stun), and basically fight with providers who put spokes into the wheels of client-to-client communications
In some cases, it is better to use someone else's ready-made servers, technologies and ready-made networks, such as cryptocurrencies (the same graphen / eos blockchains, they have public api nodes in their ideology, to which you can connect with the usual http / websocket).
ps do not do x-her, put a backend server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question