You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
connect will return a composable wrapper component
({inc2: ()=>({type: 'inc2'})}))
wrapper1(wrapper2(CounterView))
// wrapper are simply function, so you can
let wrapper = R.compose(wrapper1, wrapper2)
wrapper(CounterView)">letwrapper1=connect(i=>({inc1: ()=>({type: 'inc'})})) letwrapper2=connect(i=>({inc2: ()=>({type: 'inc2'})})) wrapper1(wrapper2(CounterView)) // wrapper are simply function, so you can letwrapper=R.compose(wrapper1,wrapper2) wrapper(CounterView)
useactions as default field to define actions
({type:'dec'}), // <-- if it confuse you why they're same level with sink$
actions: { // <-- now you can put all actions inside `actions` field
inc3: ()=>({type: 'inc3'})
},
}
})(CounterView)">constCounter=connect(intent$=>{ return{ sink$: intent$.map(...), inc: ()=>({type:'inc'}),// <-- these are actions, dec: ()=>({type:'dec'}),// <-- if it confuse you why they're same level with sink$ actions: {// <-- now you can put all actions inside `actions` field inc3: ()=>({type: 'inc3'}) }, } })(CounterView)