### Basic Usage Example Source: https://github.com/derekkraan/delta_crdt_ex/blob/master/README.md Illustrates starting two Delta CRDT instances, making them aware of each other, adding entries, and reading replicated data. ```elixir # start 2 Delta CRDTs {:ok, crdt1} = DeltaCrdt.start_link(DeltaCrdt.AWLWWMap) {:ok, crdt2} = DeltaCrdt.start_link(DeltaCrdt.AWLWWMap) # make them aware of each other DeltaCrdt.set_neighbours(crdt1, [crdt2]) # show the initial value DeltaCrdt.read(crdt1) %{} # add a key/value in crdt1 DeltaCrdt.put(crdt1, "CRDT", "is magic!") DeltaCrdt.put(crdt1, "magic", "is awesome!") # read it after it has been replicated to crdt2 DeltaCrdt.read(crdt2) %{"CRDT" => "is magic!", "magic" => "is awesome!"} # get only a subset of keys DeltaCrdt.take(crdt2, ["magic"]) %{"magic" => "is awesome!"} # get one value DeltaCrdt.get(crdt2, "magic") "is awesome!" # Other map-like functions are available, see the documentation for details. ``` -------------------------------- ### Installation Dependency Source: https://github.com/derekkraan/delta_crdt_ex/blob/master/README.md Shows how to add the delta_crdt package to your project's dependencies in mix.exs. ```elixir def deps do [ {:delta_crdt, "~> 0.6.3"} ] end ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.