Skip to content

Instantly share code, notes, and snippets.

@productioncoder productioncoder/api.js
Last active Oct 7, 2018

Embed
What would you like to do?
Youtube API reducer
import {YOUTUBE_LIBRARY_LOADED} from '../actions/api';
const initialState = {
libraryLoaded: false,
};
export default function (state = initialState, action) {
switch (action.type) {
case YOUTUBE_LIBRARY_LOADED:
return {
libraryLoaded: true,
};
default:
return state;
}
}
export const getYoutubeLibraryLoaded = (state) => state.api.libraryLoaded;
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.