Last active
April 8, 2019 23:07
-
-
Save Ledoux/85d408562fa2a41d70ac131b5db3a31a 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
| const selectStocksByOfferId = createSelector( | |
| state => state.data.stocks, | |
| state, offerId => offerId, | |
| (stocks, offerId) => stocks && stocks.filter(stock => stock.offerId === offerId) | |
| ) | |
| function mapStateToProps(state, ownProps) { | |
| const { match: { params: { offerId } } } = ownProps | |
| return { | |
| offer: selectOfferById(state, offerId), | |
| stocks: selectStocksByOfferId(state, offerId) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment