1.0.1 • Published 7 years ago

ohen v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

Ohen

Ohen makes objects observable using dirty checking.

Last version Build Status Greenkeeper badge Dev Dependencies Status NPM Status

Installation

$ npm install ohen --save

Preview

import Ohen from 'ohen';

const person = {
  name: 'Eragon',
  dragon: 'Saphira',
};

Ohen.observe(person, changes => {
  console.log(`@person: ${changes}`));
}, ['add', 'update', 'delete']);

person.father = 'Brom';
// @person: { "name": "name", "type": "update", "object": Object, "oldValue": "Eragon" }

person.name = 'Argetlam';
// @person: { "name": "father", "type": "add", "object": Object }

delete person.father;
// @person: { "name": "father", "type": "delete", "object": Object, "oldValue": "Brom" }

License

MIT © Rubén Moya