0.0.2 • Published 2 years ago
@dstanesc/shared-tree-map-sync v0.0.2
shared-tree-map sync agent
Test dynamic synchronization (eg. backup for transient collab. environments) across multiple shared-tree-map instances and relays.
See also shared-tree-map library, shared-tree-map hello world
Demo
Demonstrates incremental synchronization between two shared-tree-map instances. First shared-tree-map instantiation is used for local, low latency collaboration between collocated apps. The local relay is Tinylicious. The collaboration session is synchronized incrementally to a second shared-tree-map instance, stored in the cloud, ie. Azure Fluid Relay. The cloud instance could be used for instance as backup and recovery for the local collaboration session.

Build
npm run clean
npm run buildRun
npm startModule usage
import { mapSync, mapSyncOnce } from "@dstanesc/shared-tree-map-sync";
const sourceId = "76ecf8d1-23cd-4cea-a9c9-7007cae65e02";
const targetId = undefined;
// Sync continuously
const { sourceMap, targetMap } = await mapSync(
sourceId,
targetId,
sourceRelay,
targetRelay
);
// Sync once
const { sourceMap, targetMap } = await mapSyncOnce(
sourceId,
targetId,
sourceRelay,
targetRelay
);Licenses
Licensed under either Apache 2.0 or MIT at your option.