JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgithub.com/melanke/Watch.JS/master/src/watch.js"></script>
JavaScript
//defining our object no matter which way we want
var ex7 = {
attr1: 0,
attr2: 1
};
//defining a 'watcher' for the object
watch(ex7, function(){
alert("some attribute of ex6 changes!")
});
callWatchers(ex7, "attr1"); //invoke the watcher