json-joy
Version:
Collection of libraries for building collaborative editing apps.
21 lines (20 loc) • 537 B
JavaScript
import { ORIGIN } from '../../../json-crdt-patch/constants';
import { ValNode } from '../val/ValNode';
/**
* The root of a JSON CRDT document. {@link RootNode} is a {@link ValNode} with
* a special `0.0` ID, which is always the same. It is used to represent the
* root of a document.
*
* @category CRDT Node
*/
export class RootNode extends ValNode {
/**
* @param val Latest value of the document root.
*/
constructor(doc, val) {
super(doc, ORIGIN, val);
}
name() {
return 'root';
}
}