Skip to content

Commit e1f324e

Browse files
committed
fromPromise helper
1 parent 93f89a4 commit e1f324e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/react-most.es6

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ function observable(obj){
1515
return !!obj.observe
1616
}
1717

18-
const id = _=>_;
19-
2018
export function connect(main, initprops={}) {
2119
return function(ReactClass){
2220
class Connect extends React.Component {
@@ -26,6 +24,9 @@ export function connect(main, initprops={}) {
2624
fromEvent(e){
2725
let {type, target} = e;
2826
context[intentStream].send({type,target});
27+
},
28+
fromPromise(p){
29+
p.then(context[intentStream].send);
2930
}
3031
};
3132
let sinks = main(context[intentStream],props);

0 commit comments

Comments
 (0)