Last active
June 18, 2016 11:13
-
-
Save yornaath/374734ce36a2996940aa3f1f5ff3c0ab to your computer and use it in GitHub Desktop.
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
// Defines selectors using 'reselect' | |
import * as breedsSelectors from '../../core/domain/breeds/selectors' | |
function createSelectorMap(selectors, state) { | |
return Object.keys(selectors).reduce((selectorMap, selectorName) => { | |
selectorMap[selectorName] = (...args) => selectors[selectorName](state, ...args) | |
return selectorMap | |
}, {}) | |
} | |
const mapStateToProps = state => ({ | |
breeds: createSelectorMap(breedsSelectors, state), | |
rapports: createSelectorMap(rapportSelectors, state) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment