component/model — pull request #28 by MatthewMueller (2012-12-19 21:24:29+00:00)
Title: Added async plugin support

This pull request adds asynchronous plugin support to the `saving` and `removing` events. I found this useful on the server-side, but I'm sure some people will find it useful on the client-side.

```js
var pwd = require('pwd');

User.use(hash);

/**
* Hashing Function
*/

function hash(User) {
User.attr('salt')
User.on('saving', function(user, done) {
if(!user.isNew()) return done();
pwd.hash(user.password(), function(err, hash) {
user.salt(hash);
done();
});
}