1.0.1 • Published 11 months ago

heedful v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

heedful

Observe nested changes on (almost) anything

install

$ npm install --save heedful

api

  • someArgument (argumentType - required|optional)

usage

import { takeHeed } from 'heedful'

const onChange = (changeData) => console.log(JSON.stringify(changeData, null, 2))

const baseObject = { child: { array: [{ nested: 'deep' }] } }
const observed = takeHeed(baseObject, { onChange })

observed.child.array[0].mad = 'deep'
/* LOGGED TO CONSOLE
{
  "property": "mad",
  "target": {
    "child": {
      "array": [
        {
          "nested": "deep",
          "mad": "deep"
        }
      ]
    }
  },
  "source": {
    "nested": "deep",
    "mad": "deep"
  },
  "chain": [
    "child",
    "array",
    "0",
    "mad"
  ]
}
*/

License

MIT © Andrew Carpenter

1.0.1

11 months ago

1.0.0

11 months ago