diff --git a/packages/obaa/README.md b/packages/obaa/README.md index cd6a14279..d0f328d36 100755 --- a/packages/obaa/README.md +++ b/packages/obaa/README.md @@ -14,7 +14,7 @@ npm install obaa ```js var obj = { a: 1 }; -observe(obj, function (name, value , old) { +obaa(obj, function (name, value , old) { console.log(name + "__" + value + "__" + old); }); obj.a = 2; //a__2__1 @@ -24,7 +24,7 @@ obj.a = 2; //a__2__1 ```js var arr = [1, 2, 3]; -observe(arr, function (name, value, old) { +obaa(arr, function (name, value, old) { console.log(name + "__" + value+"__"+old); }); arr.push(4);//Array-push__[1,2,3,4]__[1,2,3] @@ -38,7 +38,7 @@ var User = function (name, age) { this.name = name; this.age = age; //observe name only - observe(this, ["name"], function (name, value, oldValue) { + obaa(this, ["name"], function (name, value, oldValue) { console.log(name + "__" + value + "__" + oldValue); }); } @@ -49,7 +49,6 @@ user.age = 20; //nothing output ## Other - ```js arr.push(111) //trigger observe callback //every method of array has a pureXXX function diff --git a/packages/obaa/package.json b/packages/obaa/package.json index ea6a9ecd1..638a0753d 100755 --- a/packages/obaa/package.json +++ b/packages/obaa/package.json @@ -1,6 +1,6 @@ { "name": "obaa", - "version": "1.0.0", + "version": "1.0.1", "description": "Observe any object's any change.", "main": "index.js", "scripts": {