| am_apply_changes | R Documentation |
Applies a list of changes (obtained from am_get_changes()) to a document.
This is useful for manually syncing changes or for applying changes received
over a custom network protocol.
am_apply_changes(doc, changes)
doc |
An Automerge document |
changes |
A list of raw vectors (serialized changes) from |
The document doc (invisibly, for chaining)
# Create two documents
doc1 <- am_create()
doc2 <- am_create()
# Make changes in doc1
am_put(doc1, AM_ROOT, "x", 1)
am_commit(doc1)
# Get changes and apply to doc2
changes <- am_get_changes(doc1, NULL)
am_apply_changes(doc2, changes)
# Now doc2 has the same data as doc1
am_close(doc1)
am_close(doc2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.