File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -77,16 +77,18 @@ TodoItem.propTypes = {
7777 completeTodo : PropTypes . func . isRequired
7878}
7979
80- const relatedTodoSelector = createSelector (
80+ const relatedTodoSelectorFactory = ( ) => createSelector (
8181 [
8282 state => state . todos ,
8383 ( _ , ownProps ) => ownProps . todo . other
8484 ] ,
8585 ( todos , otherId ) => ( { other : otherId === null ? null : todos [ otherId ] } )
8686)
8787
88+ const makeMapStateToProps = ( ) => relatedTodoSelectorFactory ( ) ;
89+
8890const ConnectedTodoItem = connect (
89- relatedTodoSelector
91+ makeMapStateToProps
9092) ( TodoItem )
9193
9294// MWE: export TodoItem for the plain scenario,
Original file line number Diff line number Diff line change 2222 "pure-render-mixin" : " ^1.0.2" ,
2323 "react" : " ^0.14.7" ,
2424 "react-dom" : " ^0.14.7" ,
25- "react-redux" : " ^4.2 .1" ,
26- "redux" : " ^3.2 .1" ,
25+ "react-redux" : " ^4.4 .1" ,
26+ "redux" : " ^3.3 .1" ,
2727 "reselect" : " ^2.3.0"
2828 },
2929 "devDependencies" : {
You can’t perform that action at this time.
0 commit comments