Last active
April 8, 2019 23:07
-
-
Save Ledoux/0647e1602eaf45e3a97a1a302d06fe90 to your computer and use it in GitHub Desktop.
This file contains 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
import { createSelector } from 'reselect' | |
const selectOfferById = createSelector( | |
state => state.data.offers, | |
(state, offerId) => offerId, | |
(offers, offerId) => (offers || []).find(offer => offer.id === offerId) | |
) | |
export default selectOfferById |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment