2.3.1 • Published 2 years ago
observed-remove v2.3.1
Observed-Remove Set and Map
Eventually-consistent, conflict-free replicated data types (CRDT) implemented using native Map
and Set
objects.
const { ObservedRemoveSet } = require('observed-remove');
const alice = new ObservedRemoveSet();
const bob = new ObservedRemoveSet();
alice.on('publish', (message) => {
setTimeout(() => bob.process(message), Math.round(Math.random() * 1000));
});
bob.on('publish', (message) => {
setTimeout(() => alice.process(message), Math.round(Math.random() * 1000));
});
alice.add('foo');
bob.add('bar');
// Later
alice.has('bar'); // true
bob.has('foo'); // true
const { ObservedRemoveMap } = require('observed-remove');
const alice = new ObservedRemoveMap();
const bob = new ObservedRemoveMap();
alice.on('publish', (message) => {
setTimeout(() => bob.process(message), Math.round(Math.random() * 1000));
});
bob.on('publish', (message) => {
setTimeout(() => alice.process(message), Math.round(Math.random() * 1000));
});
alice.set('a', 1);
bob.add('b', 2);
// Later
alice.get('b'); // 2
bob.get('a'); // 1
Install
yarn add observed-remove
Set API
Table of Contents
Map API
Table of Contents
2.3.0
2 years ago
2.3.1
2 years ago
2.2.27
4 years ago
2.2.7
4 years ago
2.2.26
4 years ago
2.2.6
4 years ago
2.2.5
5 years ago
2.2.4
5 years ago
2.2.3
5 years ago
2.2.2
5 years ago
2.2.1
5 years ago
2.2.0
5 years ago
2.1.0
5 years ago
2.0.4
5 years ago
2.0.3
6 years ago
2.0.2
6 years ago
2.0.1
6 years ago
2.0.0
6 years ago
1.5.6
6 years ago
1.5.5
6 years ago
1.5.4
6 years ago
1.5.3
6 years ago
1.5.2
6 years ago
1.5.1
6 years ago
1.5.0
6 years ago
1.4.2
6 years ago
1.4.1
6 years ago
1.4.0
6 years ago
1.3.4
6 years ago
1.3.3
6 years ago
1.3.2
6 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.0
6 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.0
6 years ago