Created
June 7, 2017 22:00
-
-
Save carlosble/b82add3db528a277865218a6dc7b27df to your computer and use it in GitHub Desktop.
Factory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const createPage = (serverApi, mapState) => { | |
return connect( | |
(state) => { | |
let mapping = { | |
report: state.report | |
}; | |
if (typeof(mapState) === 'function'){ | |
return Object.assign(mapping, mapState(state)); | |
} | |
return mapping; | |
}, | |
(dispatch) => ({ | |
// irrelevant for this post | |
}) | |
)(Page); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment