Skip to content

Cancels all pending operations in the current transaction without committing them. This allows you to discard changes since the last commit.

Usage

am_rollback(doc)

Arguments

doc

An Automerge document

Value

The document doc (invisibly)

Examples

doc <- am_create()
am_put(doc, AM_ROOT, "key", "value")
# Changed my mind, discard the put
am_rollback(doc)