TxSSC/Card-Catalog — pull request #11 by particlebanana (2012-08-16 20:50:38+00:00)
Title: Attach/Detach

Add in attach/detach methods on a category. See [Node-CMS Setup](https://github.com/TxSSC/Node-CMS/blob/master/lib/setup.js) for an example of it's use.

By putting it at the category level it moves the publish/un-publish events to application code. If it were in the card class it would be be available to any card. How something is published/un-published is also left up to the developer.

This allows you to use a generic event emitter or a redis pubsub subscriber or anything else.

I also tried to standardize the error event signature. They way I use it in the Card-Manager is:

```js
this.emit('error', { res: res, status: 400, message: 'Some Message Here' });
```

Maybe it's too verbose but it allows the most flexibility I think.