diff options
Diffstat (limited to 'app/client')
| -rw-r--r-- | app/client/modules/module.reducer.js | 7 | ||||
| -rw-r--r-- | app/client/modules/samplernn/samplernn.reducer.js | 32 |
2 files changed, 39 insertions, 0 deletions
diff --git a/app/client/modules/module.reducer.js b/app/client/modules/module.reducer.js new file mode 100644 index 0000000..de2f9bc --- /dev/null +++ b/app/client/modules/module.reducer.js @@ -0,0 +1,7 @@ +import { combineReducers } from 'redux' + +import samplernnReducer from './samplernn/samplernn.reducer' + +export const moduleReducer = combineReducers({ + samplernn: samplernnReducer +}) diff --git a/app/client/modules/samplernn/samplernn.reducer.js b/app/client/modules/samplernn/samplernn.reducer.js new file mode 100644 index 0000000..a642919 --- /dev/null +++ b/app/client/modules/samplernn/samplernn.reducer.js @@ -0,0 +1,32 @@ +import types from '../../types' + +const samplernnInitialState = { + loading: false, + error: null, + datasets: [], + results: [], +} + +const samplernnReducer = (state = samplernnInitialState, action) => { + switch(action.type) { + case types.socket.connect: + return { + ...state, + } + case types.task.task_begin: + return { + ...state, + } + case types.task.task_finish: + if (state.runner[action.task.processor].task.uuid !== action.task.uuid) { + return state + } + return { + ...state, + } + default: + return state + } +} + +export default samplernnReducer |
