File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 88 Functor ,
99 interpreterFor ,
1010 inject ,
11+ supTypeSameAs ,
1112} from 'alacarte.js'
1213
1314const compose = f => g => x => f ( g ( x ) )
@@ -87,12 +88,12 @@ const CounterView = props => (
8788CounterView . defaultProps = { count : 0 } ;
8889
8990const counterable = connect ( ( intent$ ) => {
90- return {
91- sink$ : intent$ . tap ( compose ( console . log ) ( interpretExpr ( printer ) ) )
92- . map ( interpretExpr ( interpreter ) ) ,
93- inc : ( ) => over ( lit ( 'count' ) , add ( lit ( 1 ) ) ) ,
94- dec : ( ) => over ( lit ( 'count' ) , add ( lit ( - 1 ) ) ) ,
95- }
91+ return {
92+ sink$ : intent$ . filter ( supTypeSameAs ( injector ) ) . tap ( compose ( console . log ) ( interpretExpr ( printer ) ) )
93+ . map ( interpretExpr ( interpreter ) ) ,
94+ inc : ( ) => over ( lit ( 'count' ) , add ( lit ( 1 ) ) ) ,
95+ dec : ( ) => injectOver ( injectorFrom ( [ functorLit , functorOver ] ) ) ( lit ( 'count' ) , add ( lit ( - 1 ) ) )
96+ }
9697} )
9798
9899const Counter = counterable ( CounterView )
You can’t perform that action at this time.
0 commit comments