Last active
October 16, 2019 06:24
-
-
Save cpv123/696be0e8adcddcd895d8e025f7c7244c 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' | |
export const getIsAuthenticated = state => state.isAuthenticated | |
export const getIsEligibleForPromo = state => state.isEligibleForPromo | |
const getBasket = state => state.basket | |
const getLatestOrderItems = state => state.orders.latest.items | |
export const getBasketContents = createSelector( | |
[getBasket, getLatestOrderItems], | |
(basket, latestOrderItems) => basket.map(item => !lastestOrderItems.includes(item.id)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment