object-change-callsite

1.0.5 • Public • Published

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

Package Sidebar

Install

npm i object-change-callsite

Weekly Downloads

35

Version

1.0.5

License

MIT

Unpacked Size

4.55 kB

Total Files

6

Last publish

Collaborators

  • mreinstein
  • benlyn
  • s3ththompson
  • yoshuawuyts
  • bret
  • lrlna
  • yerkopalma
  • juliangruber
  • timwis
  • ahdinosaur
  • toddself
  • sethvincent
  • maxogden
  • shama
  • freeman-lab
  • feross
  • emilbayes
  • colingourlay
  • jameskyburz
  • almost
  • slaskis
  • ungoldman
  • graforlock
  • tornqvist
  • amongiants
  • goto-bus-stop
  • mafintosh