Watch.JS icon indicating copy to clipboard operation
Watch.JS copied to clipboard

attr1 and attr2 both change that function can be invoked

Open iquanduan opened this issue 10 years ago • 2 comments

Is this feature in Watch JS? for example:

var a = { attr1: a, attr2: b }

watch(a, ['attr1', 'attr2'], function(){

})

a.attr1 = aa;

a.attr2 = bb;

I want when attr1 and attr2 both change that the function can be invoked.

Does Watch JS support this?

iquanduan avatar Jan 24 '15 14:01 iquanduan

I must do the same in project I'm working on.

I think simplest workaround would be to use underscore debounce function with small wait time, like 20ms

konradpodgorski avatar Jun 11 '15 14:06 konradpodgorski

Sadly we don't have this feature, really useful but hard to implement.

melanke avatar Mar 15 '18 23:03 melanke