0.5.0 • Published 9 years ago

observe-object-path v0.5.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Observe Object Path

npm version Circle CI

Usage

npm install -S observe-object-path
var ObserveObjectPath = require('observe-object-path').ObserveObjectPath;

var obj = {
  nested: {
    prop: 'propVal'
  }
};

var oop = new ObserveObjectPath(obj);

oop.on(['nested', 'prop'], (val) => console.log(val));

oop.update({
  nested: {
    prop: 'propNewVal'
  }
});

// Log 'propNewVal' after `update` is called

API

constructor(object: any)

on(path: string[], handler: (val: any) => void)

addEventListener(path: string[], handler: (val: any) => void)

off(path: string[], handler?: (val: any) => void)

removeEventListener(path: string[], handler?: (val: any) => void)

update(object: any)

0.5.0

9 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago