Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Emitter(target)
}
var onWatch = function(prop, action, newValue, oldValue) {
target[prop] = newValue
target.emit('change', prop, newValue, oldValue, action) // generic 'change'
target.emit('change ' + prop, newValue, oldValue, action) // reactive compatible
}
// properties is optional and we only want to spply `watch`
// with them if they are present.
var args = []
args.push(source)
properties && args.push(properties)
args.push(onWatch)
args.push(1)
watch.apply(undefined, args)
return target
}