jamesmacaulay/react-bacon — pull request #2 by leoasis (2014-04-23 19:20:33+00:00)
Title: Add 'with' function to attach custom props to the event

This PR adds a 'with' function to the handler fn so that you can set custom properties in the event before dispatching it into the `Bacon.Bus`. A typical use case for this is when you have a component that is simple enough to have the children rendered inline, and we have a handler in each particular children:

```js
/** @jsx React.DOM */
...
componentWillMount: function() {
this.eventStream('itemClicks').
doAction('.preventDefault').
map('.itemId'). // I have access to the item id that was clicked
...
},
render: function() {
var items = this.props.items.map(this.renderItem);
return

{items}

},

renderItem: function(item) {
return

}
```

I think this is a handy feature, and I've already needed something like this when using this lib, which is awesome by the way.