1.0.3 • Published 3 years ago

tinyobserver v1.0.3

Weekly downloads
6
License
ISC
Repository
github
Last release
3 years ago

tiny-observer

Observe objects for changes

Usage

import observe from 'tyniobserver';

const object = {
    a: "A string",
    b: 0
};

const callback = (prop, curr, prev) => {
    console.log('property: ', prop);
    console.log('new value: ', curr);
    console.log('previous value: ', prev);
}

const watchedObject = observe(object, callback);
watchedObject.a = "A new string";
watchedObject.c = 7;
1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago