Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

Commit

Permalink
seperate download reducer logic from song reducer
Browse files Browse the repository at this point in the history
  • Loading branch information
YogiHa committed Dec 21, 2019
1 parent 25f33ce commit 4489697
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions src/store/reducers/downloadReducer/downloadReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ import initialState from '../initialState';
export const downloadReducer = (state = initialState.downloadState, action) => {
switch (action.type) {
case 'DOWNLOAD_START':
return {
downloadState: true
};
return true;

case 'SONG_CLEARED':
case 'DOWNLOAD_END':
return {
downloadState: false
};
return false;

case 'DOWNLOAD_ERROR':
console.log(action.err);
Expand Down
9 changes: 3 additions & 6 deletions src/store/reducers/songReducer/songReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ export const songReducer = (state = initialState.song, action) => {

case 'SONG_CLEARED':
return {
downloadState: false,
song: {
url: null,
name: null,
blob: null
}
url: null,
name: null,
blob: null
};

case 'SONG_ERROR':
Expand Down

0 comments on commit 4489697

Please sign in to comment.