JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://raw.github.com/melanke/Watch.JS/master/src/watch.js"></script>

JavaScript

var ex = {
    attr: ["a", "b", "c", "d", "e"]
};

var exAttrWatcher1Cnt = 0;
var exAttrWatcher2Cnt = 0;
var exWatcherCnt = 0;

//defining a 'watchers' for the object

WatchJS.watch(ex, 'attr', function(name, oldValue, newValue){
    exAttrWatcher1Cnt++;
    console.log('Call #' + exAttrWatcher1Cnt + ' for first watcher of ex.attr: ' + this.attr.toString());
});

WatchJS.watch(ex, 'attr', function(name, oldValue, newValue){
    exAttrWatcher2Cnt++;
    console.log('Call #' + exAttrWatcher2Cnt + ' for second watcher of ex.attr: ' + this.attr.toString());
});

WatchJS.watch(ex, function(name, oldValue, newValue){
    exWatcherCnt++;
    console.log('Call #' + exWatcherCnt + ' for ex: ' + this.attr.toString());
});

//when changing one of the attributes of the object multiple watchers are invoked
ex.attr.push("f");