JSPM

object-change-callsite

1.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 43
  • Score
    100M100P100Q71218F
  • License MIT

Determine the callsite of an object change using Proxies

Package Exports

  • object-change-callsite

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (object-change-callsite) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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