alexis-j
9/19/2017 - 10:13 AM

Make singelisered and sort an array of tag

Extract tags from a blog post list as an array of sorted and unique tags.

const tags = allPosts
  .reduce(
      (acc, post) => Array.from(new Set([...acc, ...post.tags])),
      [],
  )
  .sort();