Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Youtube video categories reducer function
function reduceFetchVideoCategories(response, prevState) {
const categoryMapping = response.items.reduce((accumulator, category) => {
accumulator[] = category.snippet.title;
return accumulator;
}, {});
return {
categories: categoryMapping,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.