Skip to content

Commit 78fd796

Browse files
committed
Add a new inputStream to forward keyed inputs by name
1 parent 1584d55 commit 78fd796

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/react-bacon.js

+9
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ module.exports.BaconMixin = ((function(){
5656
return function sendEventToStream(event) { bus.push(event.target.value); };
5757
});
5858
},
59+
inputStream: function(eventName) {
60+
return eventBus(this, eventName, function (bus) {
61+
return function sendEventToStream(event) {
62+
var v = {};
63+
v[event.target.name] = event.target.value;
64+
bus.push(v);
65+
};
66+
});
67+
},
5968
domEventStream: function(eventName, prevDefault, stopPropagation) {
6069
if (typeof prevDefault == "undefined") prevDefault = true;
6170
if (typeof stopPropagation == "undefined") stopPropagation = true;

0 commit comments

Comments
 (0)