melanke / Watch.JS

watch the changes of any object or attribute
Other
2.14k stars 219 forks source link

Unwatch in a callback function #96

Closed kelvien closed 7 years ago

kelvien commented 8 years ago

Can we actually do an unwatch on the callback function?

For an example:

var callback1 = function(){
// Some process
unwatch(this, "a");
}

watch(this, "a", callback1)

I can't seem to have this to work