The type of the value contained in the document
The document to update
Either a message, an ChangeOptions, or a ChangeFn
Optional
callback: ChangeFn<T>A ChangeFn
to be used if options
was a string
Note that if the second argument is a function it will be used as the ChangeFn
regardless of what the third argument is.
let doc1 = automerge.init()
doc1 = automerge.change(doc1, d => {
d.key = "value"
})
assert.equal(doc1.key, "value")
doc1 = automerge.change(doc1, "add another value", d => {
d.key2 = "value2"
})
Update the contents of an automerge document