Skip to content

Minimal module to watch javascript object for changes.

License

Notifications You must be signed in to change notification settings

Eun/minWatch.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

minWatch.js

Minimal module to watch javascript object for changes.

Example

var data = {
	"Key1": "Value1",
	"Key2": 2,
	"ArrayKey": [4,5,6]
};

minWatch(data, function(object, attr, oldValue, newValue)
{
	if (attr == "Key2")
	{
		newValue = 4;
	}
	console.log("Changing ", object, attr, " to ", newValue)
	return newValue;
});

data["Key1"] = 'Test';
data["Key2"] = 3;

About

Minimal module to watch javascript object for changes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published