import types from '../../types' import datasetReducer from '../../dataset/dataset.reducer' const samplernnInitialState = { loading: true, progress: { i: 0, n: 0 }, error: null, folders: [], folder_id: 0, data: null, lossReport: null, results: null, } const samplernnReducer = (state = samplernnInitialState, action) => { if (action.data && action.data.module === 'samplernn') { return datasetReducer(state, action) } switch(action.type) { case types.samplernn.load_loss: return { ...state, lossReport: action.lossReport, } case types.samplernn.load_graph: return { ...state, lossReport: action.lossReport, results: action.results, } default: return state } } export default samplernnReducer