1.1.0 • Published 6 years ago

@cjssdk/property-watcher v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Watches for a property modifications

build status npm version dependencies status devDependencies status Gitter RunKit

Installation

npm install @cjssdk/property-watcher

Usage

Add to the scope:

var watch = require('@cjssdk/property-watcher');

Add hook for an object property:

var obj = {
    fld: 123
};

watch(obj, 'fld', function ( name, oldValue, newValue ) {
    console.log('obj.' + name + ' changed from ' + oldValue + ' to ' + newValue);
});

Trigger the hook with property modification:

obj.fld = 256;

Contribution

If you have any problems or suggestions please open an issue according to the contribution rules.

License

@cjssdk/property-watcher is released under the MIT License.