Solid Automerge - v3.0.0
    Preparing search index...

    Function mutable

    • get a mutable version of a document projection (from useDocument, createDocumentProjection or makeDocumentProjection).

      reading from it is reading from the projection: fine-grained and live. writing to it makes an automerge change on the handle, which comes back to the projection as patches. every assignment, delete, push, splice etc is its own change; for several edits in one change, use handle.change.

      const todo = mutable(doc)
      todo.done = true
      todo.tags.push("urgent")
      delete todo.dueDate

      nested objects are views of whatever is at their path in the document right now, so todo.tags always means the current tags. writes under a key with a document mounted on it go to the mounted document.

      sort, reverse and copyWithin throw. automerge has no way to move an item in a list, so they would have to delete every item and insert it again, which turns nested objects into copies and merges badly with anyone else editing the list. splice it into its new order yourself if you mean it.

      Type Parameters

      • T extends object

      Parameters

      • doc: T

      Returns T