From b89147ecd38b0f95a2e4917aba7f44bf3bb70327 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 7 Jul 2017 18:43:24 +0200 Subject: refactor audioplayer --- client/reducers/audioPlayer.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 client/reducers/audioPlayer.js (limited to 'client/reducers/audioPlayer.js') diff --git a/client/reducers/audioPlayer.js b/client/reducers/audioPlayer.js new file mode 100644 index 0000000..6ad4022 --- /dev/null +++ b/client/reducers/audioPlayer.js @@ -0,0 +1,20 @@ +import client from '../client' + +const audioPlayer = (state = {}, action) => { + switch (action.type) { + case 'AUDIO_PLAY_FILE': + return { + ...state, + file: action.file + } + case 'AUDIO_PAUSE': + return { + ...state, + paused: ! state.paused, + } + default: + return state + } +} + +export default audioPlayer \ No newline at end of file -- cgit v1.2.3-70-g09d2