immutable-crdt
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

CRDT library for immutable apps. Here's a simple:

import {Document} from "immutable-crdt";

let person = {
  firstName: "a",
  lastName: "b"
};

const doc2 = Document.initialize(person);
const doc = Document.initialize(person);
const mutations = doc.updateState({...person, firstName: "blah", lastName: "blah"});

doc2.applyMutations(mutations);
console.log(doc2.getState()); // { firstName: "blah", lastName: "blah" }

TODOS:

  • [ ] remove ID check
  • [ ] history
  • [ ] cache mutations that
  • [ ] snapshotting state for performance
  • [ ] benchmark testing
  • [ ] persistence
  • [ ] conflict resolution
  • [ ] pubnub examples
  • [ ] prevent applied mutations from being

Caveats:

  • Diffing method doesn't work for certain scenarios such as incrementing

Readme

Keywords

none

Package Sidebar

Install

npm i immutable-crdt

Weekly Downloads

0

Version

1.1.5

License

ISC

Unpacked Size

137 kB

Total Files

51

Last publish

Collaborators

  • crcn