redux-eventually
Redux-eventually facilitates using CRDTs inside of the redux store. This library consists of factory methods for easier usage with the otherwise quite cumbersome data-structures.
Example Counter
; const COUNTER = "COUNTER"; ;/*{ type: COUNTER, payload: { id: "adam", value: 1 }}*/ ;/*{ type: "pn-counter", p: { adam: 1, gustav: 0 }, n: { adam: 1, gustav: 1 }}*/ ; let store = ;const state = ;const todos = ;
Example LSEQ
; const ADD_TODO = "ADD_TODO";const REMOVE_TODO = "REMOVE_TODO"; // createEventualAction(actionType, operation); ; // createEventualReducer(stateConfig); // eventualSelector returns a non-crdt representation; // Simple usagelet store = ;const state = ;const todos = ;