Skip to content

Commit

Permalink
[add] Document Model#use method.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaodubas committed Jan 15, 2014
1 parent 942b993 commit ae6c829
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,26 @@ var properties = [
var User = model.createModel('User', properties);
```

### .use(function)

Allow to extend the model with custom behavior through a function.

```javascript
var model = require('blueprint-model');
var User = model.create('User');
User
.setProperty('username')
.setProperty('email')
.setProperty('password')
.use(function (Model) {
function logger() {
console.log('action => ', arguments.join(' : ');
}
Model.on('construct', logger);
Model.on('change', logger);
});
```
## Events
### Constructor
Expand Down

0 comments on commit ae6c829

Please sign in to comment.