@jacobbubu/crdt-pull
v1.0.2
Published
[![Build Status](https://travis-ci.org/jacobbubu/crdt-pull.svg)](https://travis-ci.org/jacobbubu/crdt-pull) [![Coverage Status](https://coveralls.io/repos/github/jacobbubu/crdt-pull/badge.svg)](https://coveralls.io/github/jacobbubu/crdt-pull) [![npm](http
Downloads
6
Readme
@jacobbubu/crdt-pull
Rewritten crdt in TypeScript and work with scuttlebutt-pull
Intro.
``
Usage
npm install @jacobbubu/crdt-pull
import { Doc } from '../src'
import { link } from '@jacobbubu/scuttlebutt-pull'
import { delay } from './utils'
const main = async () => {
const doc = new Doc({ id: 'doc' })
const hoc = new Doc({ id: 'hoc' })
const ds = doc.createStream({ name: 'd-h', wrapper: 'raw' })
const hs = hoc.createStream({ name: 'h-d', wrapper: 'raw' })
link(ds, hs)
doc.add({ id: 'abc', hello: 3 })
await delay(100)
console.log(hoc.toJSON())
}
// tslint:disable-next-line no-floating-promises
main()
Please see the test cases for the detail.