A common approach to building JavaScript apps involves keeping the state of your application in model objects, such as a JSON document. For example, i

automerge / automerge

submited by
Style Pass
2021-06-10 09:30:05

A common approach to building JavaScript apps involves keeping the state of your application in model objects, such as a JSON document. For example, imagine you are developing a task-tracking app in which each task is represented by a card. In vanilla JavaScript you might write the following:

You can have a copy of the application state locally on several devices (which may belong to the same user, or to different users). Each user can independently update the application state on their local device, even while offline, and save the state to local disk.

When a network connection is available, Automerge figures out which changes need to be synced from one device to another, and brings them into the same state.

If the state was changed concurrently on different devices, Automerge automatically merges the changes together cleanly, so that everybody ends up in the same state, and no changes are lost.

Automerge keeps track of the changes you make to the state, so that you can view old versions, compare versions, create branches, and choose when to merge them.

Leave a Comment
Related Posts