import { useTypedSelector } from '../../../hooks/useTypedSelector' ; import { ArticleSortingOption } from '../../../types/redux/articles-reducer-types' ; function returns { object } export const useArticleFiltersMenuConfig = ( ) : { allTags : Array < string > ; allSortingOptions : Array < ArticleSortingOption > ; } => { const { articles } = useTypedSelector ( ( state ) => state . articles ) ; const allTags = articles . reduce ( ( acc , article ) => [ ... acc , ... article . tag_list ] , [ ] as Array < string > ) ; const allSortingOptions = [ 'likes' , 'date' , 'views' , ] ; return { allTags , allSortingOptions } ; } ;