🎨 add getAllTags & remove polyfill

This commit is contained in:
Kevin Van Der Werff
2019-10-21 23:27:53 +02:00
parent 43fb35486e
commit 1559ec7370
2 changed files with 18 additions and 28 deletions

View File

@@ -24,6 +24,14 @@ export const isNotEmpty = R.compose(R.not, R.isEmpty)
// getAllResources :: [Category] -> [Resource]
export const getAllResources = R.compose(R.flatten, R.map(R.prop('resources')))
// getAllTags :: [Category] -> [String]
export const getAllTags = R.compose(
R.uniq,
R.flatten,
R.map(R.prop('tags')),
getAllResources
)
// tagsNotEmpty :: Resource -> Bool
export const tagsNotEmpty = R.compose(isNotEmpty, R.prop('tags'))