Last active
May 22, 2018 08:01
-
-
Save kettanaito/8d556fbf5219ab6c3db3b849516663ec to your computer and use it in GitHub Desktop.
Redux - Selector
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
// cart/selectors.js | |
export const getTotalPrice = (cart) => { | |
return cart.get('items').reduce((acc, item) => { | |
return acc + item.get('price') | |
}, 0) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment