twitter/flight — pull request #60 by dannymidnight (2013-03-04 03:38:21+00:00)
Title: Add callback trigger function

I find myself constantly wanting to trigger an event on execution of a callback (eg. Trigger an event on an ajax response).

```javascript
this.doSomething = function() {
$.get('/hello', $.proxy(function() {
this.trigger('world', arguments);
}, this));
}
```

Not sure if other people are doing this or a lot or just myself! This pull request adds a new `thenTrigger()` method to component.js to simplify the process of triggering an event on the calling component on execution of a callback.

eg.
```javascript
this.doSomething = function() {
$.get('/hello', this.thenTrigger('world');
}

this.on('world', function(e, res) {
// Arguments are passed through if needed.
console.log(res);
});
```

Is this something that would help others?