27 lines
752 B
JavaScript
Executable File
27 lines
752 B
JavaScript
Executable File
|
|
export default function reducer(spotify = {}, action){
|
|
switch (action.type) {
|
|
|
|
case 'SPOTIFY_CONNECTING':
|
|
return Object.assign({}, spotify, { connected: false, connecting: true });
|
|
|
|
case 'SPOTIFY_AUTHORIZING':
|
|
return Object.assign({}, spotify, { authorizing: true });
|
|
|
|
case 'SPOTIFY_CONNECTED':
|
|
return Object.assign({}, spotify, { connected: true, connecting: false });
|
|
|
|
case 'SPOTIFY_DISCONNECTED':
|
|
return Object.assign({}, spotify, { connected: false, connecting: false });
|
|
|
|
case 'SPOTIFY_ALBUM_LOADED':
|
|
return Object.assign({}, spotify, { album: action.data });
|
|
|
|
default:
|
|
return spotify
|
|
}
|
|
}
|
|
|
|
|
|
|