summaryrefslogtreecommitdiff
path: root/app/client/modules/pix2pix/pix2pix.reducer.js
blob: fbd38d137ed3975faa86c18d41c4fa69158b9e92 (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
import types from '../../types'

const pix2pixInitialState = {
  loading: true,
  error: null,
  folders: [],
  folder_id: 0,
  data: null,
  lossReport: null,
}

const pix2pixReducer = (state = pix2pixInitialState, action) => {
  // console.log(action.type)
  switch(action.type) {
    case types.pix2pix.init:
      return {
        ...state,
        loading: false,
        data: action.data,
      }

    case types.socket.connect:
      return {
        ...state,
      }

    case types.task.task_begin:
      return {
        ...state,
      }

    case types.task.task_finish:
      return {
        ...state,
      }

    default:
      return state
  }
}

export default pix2pixReducer