object-change-callsite

v1.0.5
Determine the callsite of an object change using Proxies
object change callsite proxy

object-change-callsite

npm version build status downloads js-standard-style

Determine the callsite of an object change using Proxies.

Usage

var onChange = require('object-change-callsite')

var state = {}
state = onChange(state, function (attr, value, callsite) {
  console.log(`${attr} changed to ${value} at ${callsite}`)
})

state.foo = 'hello'
state.bar = 'world'

API

onChange(target, callback(attribute, value, callsite))

Detect changes on the target object.

License

MIT

npm i object-change-callsite

Metadata

  • MIT
  • Whatever
  • Unknown
  • released 2/12/2018

Downloads