Watch.JS
Watch.JS copied to clipboard
npm watch.js is out of date, silently breaks on examples
The following example is taken directly from the current watch.js docs:
var WatchJS = require("watchjs")
//defining our object no matter which way we want
var ex = {
l1a: "bla bla",
l1b: {
l2a: "lo lo",
l2b: "hey hey"
}
};
WatchJS.watch(ex, function (prop, action, difference, oldvalue){
console.log("prop: "+prop+"\n action: "+action+"\n difference: "+JSON.stringify(difference)+"\n old: "+JSON.stringify(oldvalue)+"\n ... and the context: "+JSON.stringify(this));
}, 0, true);
ex.l1b.l2c = "new attr"; //it is not instantaneous, you may wait 50 miliseconds
setTimeout(function(){
ex.l1b.l2c = "other value";
}, 100);
This will silently fail on watch.js as implemented on npm. Replacing node_modules/src/watch.js with the current one from github will fix the issue.
I can reproduce this on demand if needed BTW.
well the WatchJS of the npm is outdated, someone else is the maintaner and I have no control =/ I've already asked to be added as mainteiner, do you know how I could fix this?
Both the version on NPM and the version in this repo are silently failing on Node for me, using the above example.
I'm using Node v0.10.26.
The 'watchjs' uploaded to npm is maintained by Matt Bell (@mappum) - Matt could you please transfer the package to Gil (@melanke) ?