From 2313cc4bb4d6c511c76d28020c1c97e6a5eb0a4d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 17 Mar 2021 18:36:14 +0100 Subject: audio actually playing --- frontend/site/audio/audio.reducer.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 frontend/site/audio/audio.reducer.js (limited to 'frontend/site/audio/audio.reducer.js') diff --git a/frontend/site/audio/audio.reducer.js b/frontend/site/audio/audio.reducer.js new file mode 100644 index 0000000..f0bf0e9 --- /dev/null +++ b/frontend/site/audio/audio.reducer.js @@ -0,0 +1,18 @@ +import AudioPlayer from 'site/audio/audio.player' +import * as types from 'site/types' + +const initialState = { + player: new AudioPlayer(), +} + +export default function audioReducer(state = initialState, action) { + // console.log(action.type, action) + switch (action.type) { + case types.site.loaded: + state.player.load(action.data.graph) + return state + + default: + return state + } +} -- cgit v1.2.3-70-g09d2