Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tristanpendergrass/7f3445d793108a1cd055ce3455d00cb7 to your computer and use it in GitHub Desktop.
Save tristanpendergrass/7f3445d793108a1cd055ce3455d00cb7 to your computer and use it in GitHub Desktop.
// 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