An open API service indexing awesome lists of open source software.

https://github.com/hwclass/observables.js

An small object tracing and logging library.
https://github.com/hwclass/observables.js

Last synced: 4 months ago
JSON representation

An small object tracing and logging library.

Awesome Lists containing this project

README

          

observables.js

An small object tracing and logging library.

### Usage

#### You can have a plain JS object watched



var testObj = {};
observables.trace([testObj]);
/*when the changing occurs like below:*/
test.firstProp = "Changed property."
/*console is logged with the current object is changed and its new value.*/
console => prop:a was add and is now 1

#### You can have a plain JS object not to be watched



observables.leave([testObj]);
/*console is logged with the current object is leaved alone.*/
console => [object Object] is now unobservable.

#### You can have a plain JS object frozen (so, not to let it change its value)



observables.freeze([testObj]);
/*console is logged with the current object is freezed.*/
console => [object Object] is now unchangable.

#### You can have objects observed, unobserved and frozen



observables.trace([testObj1, testObj2, testObj3]);
observables.leave([testObj1, testObj2, testObj3]);
observables.freeze([testObj1, testObj2, testObj3]);