Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
y1j2x34 committed Nov 9, 2017
1 parent 48cb72f commit c16ed69
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,27 @@ flyingPuppy.eat(); // puppy eat
flyingPuppy.smile();// smilling puppy


```

### Proxy

```js
var Cat = Class.create({
miao: function(){
console.info('miao~~~');
return 'miao';
}
});
var cat = new Cat();
var proxy = Class.proxy(cat, function(func, args){
console.info('before~');
var ret = func.apply(this, arg);
console.info('after~');
return ret;
});
proxy.miao(); // returns 'miao'
// output:
// before~
// miao~~~
// after~
```
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "class.js",
"name": "@y1j2x34/class.js",
"version": "1.0.0",
"description": "Simple class system for low level javascript which includes inheritance, mixins, inherited statics, python style, proxy...",
"main": "index.js",
Expand All @@ -18,6 +18,11 @@
"url": "https://github.com/y1j2x34/Class.js/issues"
},
"homepage": "https://github.com/y1j2x34/Class.js#readme",
"files": [
"./Class.js",
"./Class.min.js",
"./test/*"
],
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
Expand All @@ -41,5 +46,8 @@
"phantomjs-polyfill-object-assign": "0.0.2",
"webpack": "^3.8.1"
},
"dependencies": {}
"dependencies": {},
"directories": {
"test": "test"
}
}

0 comments on commit c16ed69

Please sign in to comment.