maca/crdt-replicated-tree/5.0.0

Formerly maca/crdt-replicated-graph. Search finds this package by either name.

CRDTree.Operation

Represents an CRDTree operation

type Operation a
= Add Int (List Int) a
| Delete (List Int)
| Batch (List (Operation a))

Represents an CRDTree operation

Properties

timestamp : Operation a -> Maybe Int

Timestamp of the operation

path : Operation a -> Maybe (List Int)

Operation path

replicaId : Operation a -> Maybe Int

Id of the replica originating the operation

List

since : Int -> List (Operation a) -> List (Operation a)

Return operations since a timestamp

toList : Operation a -> List (Operation a)

Operation to List of Operations

fromList : List (Operation a) -> Operation a

List of Operations to Batch

Manipulation

Merge two operations