I am building a multi-player Todo app. I am sending the entire todo state to the server and the server broadcasts it to the other clients. How can I use SyncState and how will it be efficient?
I am building a multi-player Todo app. I am sending the entire todo state to the server and the server broadcasts it to the other clients. How can I use SyncState and how will it be efficient?
In case of SyncState, we send patches for communication. Patches, in general, is just the change in the current state. This allows us to send only the required data and not the entire thing, thus reducing the size of data being transferred. Doing this also provides us with a few more benefits:
You can refer to the talk by the creator of SyncState for more in-depth explanation of using JSON patches for building multi-user apps.