@inventory/debug-prop - v0.0.4
Functions
debugProp
- debugProp<Prop, ValType>(prop: Prop, format?: function): applyDebugger
-
Type parameters
-
Prop: string
-
ValType: any
Parameters
-
prop: Prop
-
Default value format: function = val => `${prop} = ${val}`
Returns applyDebugger
Easily debug property changes on an object.
const debugCount = debugState('count') const obj1 = { count: 1 } debugCount(obj1, 'debug-prop:obj1') obj1.count++ const obj2 = { count: 1 } debugCount(obj2, 'debug-prop:obj2') obj2.count++ // logs => debug-prop:obj1 state = 2 // logs => debug-prop:obj2 state = 2