summaryrefslogtreecommitdiff
path: root/app/client/modules/samplernn/samplernn.reducer.js
blob: b3b58c350b1ce70ccb6ee8fd0046e4313644baa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import types from '../../types'

const samplernnInitialState = {
  loading: false,
  error: null,
  folders: [],
  datasets: [],
  results: [],
  input: {
    folder: {},
    files: [],
  },
  output: {
    folder: {},
    files: [],
  },
}

const samplernnReducer = (state = samplernnInitialState, action) => {
  console.log(action)
  switch(action.type) {
    case types.task.task_begin:
      return {
        ...state,
      }
    case types.task.task_finish:
      return {
        ...state,
      }

    case types.socket.status:
      return samplernnSocket(state, action.data)
    default:
      return state
  }
}

const samplernnSocket = (state, action) => {
  console.log(action)
  switch (action.key) {
    default:  
      return state
  }
}

export default samplernnReducer