Last active
June 12, 2017 12:31
-
-
Save rrmdn/811ac241ee6561eef41ea8aa4e988bcb 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 isInQuantity = R.propOr(0, 'quantity'); | |
| const isNotIllegal = R.pathEq(false, ['metadata', 'isIllegal']); | |
| const isGood = R.pathEq('good', ['metadata', 'status']); | |
| const isDamaged = R.pathEq('damaged', ['metadata', 'status']); | |
| const available = R.filter(R.allPass([ | |
| isInQuantity, | |
| isNotIllegal, | |
| isGood, | |
| ])); | |
| const availableProducts = available(products); | |
| const damaged = R.filter(R.allPass([ | |
| isInQuantity, | |
| isNotIllegal, | |
| isDamaged, | |
| ])); | |
| const damagedProducts = damaged(products); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment