0.5.0 • Published 8 years ago

observe-object-path v0.5.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 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

8 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago