🎨 replace R.map(R.prop) by R.pluck (equivalent).

refactor state.tags & state.resources
This commit is contained in:
Kevin Van Der Werff
2019-10-21 23:37:02 +02:00
parent 1559ec7370
commit d422425be4
2 changed files with 4 additions and 5 deletions

View File

@@ -22,13 +22,13 @@ const Category = {
export const isNotEmpty = R.compose(R.not, R.isEmpty)
// getAllResources :: [Category] -> [Resource]
export const getAllResources = R.compose(R.flatten, R.map(R.prop('resources')))
export const getAllResources = R.compose(R.flatten, R.pluck('resources'))
// getAllTags :: [Category] -> [String]
export const getAllTags = R.compose(
R.uniq,
R.flatten,
R.map(R.prop('tags')),
R.pluck('tags'),
getAllResources
)