Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/automerge/counter.ts

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
Latest
import * as automerge from "https://deno.land/x/automerge@2.2.2/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.