object-change-callsite

Determine the callsite of an object change using Proxies

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
object-change-callsite
1.0.56 years ago6 years agoMinified + gzip package size for object-change-callsite in KB

Readme

object-change-callsite
!npm version23 !build status45 !downloads89 !js-standard-style1011
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