ohen

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i ohen

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • rubenmoya