Skip to main content
Module

x/automerge/counter.ts

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
Go to Latest
import * as automerge from "https://deno.land/x/automerge@2.2.0/counter.ts";

Classes

The most basic CRDT: an integer value that can be changed only by incrementing and decrementing. Since addition of integers is commutative, the value trivially converges.

Functions

Returns an instance of WriteableCounter for use in a change callback. context is the proxy context that keeps track of the mutations. objectId is the ID of the object containing the counter, and key is the property name (key in map, or index in list) where the counter is located.