You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m building an offline-first Electron app and using Legend-State for state management. I need to sync state changes between multiple Electron instances over a local network (LAN) without internet.
For example, if John updates inventory on one PC, Sarah's PC should reflect the change automatically over LAN.
Questions:
Can Legend-State handle peer-to-peer sync over LAN?
If not, what’s the best way to combine it with WebRTC or WebSockets?
How would Legend-State handle conflicts if multiple users update the same state?
The text was updated successfully, but these errors were encountered:
Yes, Legend State is totally agnostic to your sync system. You can build a custom plugin on top of synced that fetches from whatever you want - it just needs to return a Promise. It could be a remote server, or a server on a LAN, or even call a function through Electron. See this whole page but especially this last section: https://legendapp.com/open-source/state/v3/sync/persist-sync/#making-a-sync-plugin.
If your sync system would have multiple rows, you might want to build on top of the crud plugin rather than the raw synced.
For conflicts, there's not a specific conflict resolution system at the moment, though that's planned soon. For now it's basically just last write wins.
I'm very aware that the documentation for building custom plugins is quite lacking! So please feel free to ask a lot of questions - I'm happy to answer them and that would help with knowing what to add to the docs.
I’m building an offline-first Electron app and using Legend-State for state management. I need to sync state changes between multiple Electron instances over a local network (LAN) without internet.
For example, if John updates inventory on one PC, Sarah's PC should reflect the change automatically over LAN.
Questions:
The text was updated successfully, but these errors were encountered: