Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.
/ hadron-document Public archive

Document model with element level dirty tracking.

License

Notifications You must be signed in to change notification settings

mongodb-js/hadron-document

Repository files navigation

hadron-document

Hadron Document is a wrapper for javascript objects that represent documents in a database intended for use with React components. It provides element (key/value pair) level dirty tracking with the ability to add, edit, delete and revert changes to elements directly.

Installation

npm install --save hadron-document

Usage

'use strict';

const Document = require('hadron-document');

var object = {
  _id: 'aphex-twin',
  name: 'Aphex Twin',
  locations: [ 'London' ],
  emails: {
    home: 'home@aphextwin.com',
    work: 'work@aphextwin.com'
  }
}

var doc = new Document(object);

License

Apache 2.0