Created
November 12, 2017 15:48
-
-
Save tristanpendergrass/7f3445d793108a1cd055ce3455d00cb7 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
// imperative | |
const isSelected = playlist => { | |
const slides = getOr([], 'config.slides', playlist); | |
return some(matchesProperty('key', item.key), slides); | |
}; | |
// functional | |
const isSelected = compose([ | |
partial(some, matchesProperty('key', item.key)), | |
partial(getOr, [], 'config.slides'), | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment