UNPKG

media_player_wrapper

Version:
35 lines (30 loc) 585 B
const nowPlayingReducer = ( //Initial State of the reducer state = { playbackState: "Connecting", isPlaying: false, volume: 0.0 }, action ) => { switch (action.type) { case "SET_PLAYBACK_STATE": return { ...state, playbackState: action.playbackState }; case "SET_IS_PLAYING": return { ...state, isPlaying: action.value }; case "SET_VOLUME": return { ...state, volume: action.volume }; default: return state; } }; export default nowPlayingReducer;