Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Last active October 7, 2018 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/1c75676b7ce87542b856805842a50c37 to your computer and use it in GitHub Desktop.
Save productioncoder/1c75676b7ce87542b856805842a50c37 to your computer and use it in GitHub Desktop.
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