summaryrefslogtreecommitdiff
path: root/client/reducers/audioPlayer.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-07-07 18:43:24 +0200
committerJules Laplace <julescarbon@gmail.com>2017-07-07 18:43:24 +0200
commitb89147ecd38b0f95a2e4917aba7f44bf3bb70327 (patch)
tree554d0d726755c89e55dbe79f0339cceb13543dd5 /client/reducers/audioPlayer.js
parentd520c67839724e80d8b68b8fe933f1e7755a8f42 (diff)
refactor audioplayer
Diffstat (limited to 'client/reducers/audioPlayer.js')
-rw-r--r--client/reducers/audioPlayer.js20
1 files changed, 20 insertions, 0 deletions
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