Learn R Programming

automerge (version 0.4.0)

am_pending_ops: Get the number of pending operations

Description

Returns the number of operations that have been applied to the document but not yet committed. This is useful for determining whether a commit is needed.

Usage

am_pending_ops(doc)

Value

An integer indicating the number of pending operations. Returns 0 if there are no uncommitted changes.

Arguments

doc

An Automerge document

Examples

Run this code
doc <- am_create()
am_pending_ops(doc)  # 0

doc$key <- "value"
am_pending_ops(doc)  # > 0

am_commit(doc)
am_pending_ops(doc)  # 0

am_close(doc)

Run the code above in your browser using DataLab