micro-object-observer

1.0.4 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i micro-object-observer

Weekly Downloads

4

Version

1.0.4

License

ISC

Unpacked Size

1.68 kB

Total Files

3

Last publish

Collaborators

  • arnack