Learn R Programming

automerge (version 0.4.0)

am_change_actor_id: Get the actor ID of a change

Description

Returns the actor ID of the peer that created the change.

Usage

am_change_actor_id(change)

Value

A raw vector containing the actor ID bytes

Arguments

change

An am_change object (from am_get_changes() or am_change_from_bytes())

Examples

Run this code
doc <- am_create()
am_put(doc, AM_ROOT, "key", "value")
am_commit(doc, "Add key")

history <- am_get_changes(doc)
actor <- am_change_actor_id(history[[1]])
actor

# Should match the document's actor
identical(actor, am_get_actor(doc))  # TRUE

am_close(doc)

Run the code above in your browser using DataLab