| am_sync_decode | R Documentation |
Receives a synchronization message from a peer and applies the changes to the local document. This updates both the document and the sync state to reflect the received changes.
am_sync_decode(doc, sync_state, message)
doc |
An Automerge document |
sync_state |
A sync state object (created with |
message |
A raw vector containing an encoded sync message |
The document doc (invisibly, for chaining)
doc <- am_create()
sync_state <- am_sync_state_new()
# Receive message from peer
# message <- ... (received from network)
# am_sync_decode(doc, sync_state, message)
am_close(doc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.