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.
- Host: GitHub
- URL: https://github.com/hwclass/observables.js
- Owner: hwclass
- License: mit
- Created: 2014-06-04T21:49:16.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2017-04-13T12:42:47.000Z (about 9 years ago)
- Last Synced: 2025-06-02T07:16:49.585Z (about 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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]);