import types from '../../types' const samplernnInitialState = { loading: false, error: null, folder: {}, folders: [], files: [], 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, } case types.folder.index: console.log(action) return { ...state, folders: action.data, folder: action.data[0], } case types.folder.update: console.log(action) return state case types.file.index: console.log(action) return { ...state, files: action.data } case types.file.create: console.log(action) return { ...state, files: [action.data].concat(this.files) } return default: return state } } export default samplernnReducer