micro-object-observer
v1.0.4
Published
Handle Objects changes
Downloads
3
Readme
Watch an object or array for changes
Uses the Proxy API.
Install
$ npm install micro-object-observer
Usage
const onChange = require('micro-object-observer');
const object = {
a: "str",
b: 8
};
const watchedObject = onChange(object);
watchedObject.a = "new str";
If you want to detect changes of literals (Numbers/Strings) you have to wrap them into an object
const literalWrapper = {
numberLiteral = 0,
...
}