1.0.0 • Published 6 years ago
obj-watcher-observe v1.0.0
obj-watcher
The watcher method watches for a property to be assigned a value and runs a function when that occurs.
example
const source = {
name: 'zezhipeng'
}
const data = new Watcher(source)
data.watch('name', console.log)
data.name = 'cjh' // { oldVal: 'zezhipeng', newVal: 'cjh }
console.log(source) // { name: 'cjh' }
1.0.0
6 years ago