1.0.4 • Published 5 years ago

micro-object-observer v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

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,
    ...
}
1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago