diff --git a/store/data.js b/store/data.js index 48610a9..a103289 100644 --- a/store/data.js +++ b/store/data.js @@ -21,13 +21,12 @@ export const state = () => ({ } }), })), - // List of all tags, duplicates removed tags: getAllTags(resources), }) export const getters = { - tags: state => state.tags, - resources: state => state.resources, + tags: R.prop('tags'), + resources: R.prop('resources'), findCategory: state => categoryTitle => { // equalsCategoryTitle :: Category -> Bool const equalsCategoryTitle = R.compose( diff --git a/utils/pure.js b/utils/pure.js index 997fbe2..902e791 100644 --- a/utils/pure.js +++ b/utils/pure.js @@ -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 )