Created
April 5, 2017 19:28
-
-
Save codeaholicguy/174a073c407d2d4464edc6a6fdc2cbb4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {ActionTypes} from '../core/constants'; | |
const initialState = { | |
tracks: [], | |
activeTrack: null | |
}; | |
export default function(state = initialState, action) { | |
switch (action.type) { | |
case ActionTypes.TRACK_PLAY: | |
return setActiveTrack(state, action) | |
} | |
return state; | |
} | |
function setActiveTrack(state, action) { | |
const {track} = action; | |
return {...state, activeTrack: track}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment