summaryrefslogtreecommitdiff
path: root/animism-align/frontend/views/site/site.reducer.js
blob: e80033f5fa5d0bc404a572208fcd626fe81c18b4 (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
import * as types from '../../types'
// import { session, getDefault, getDefaultInt } from '../../session'

const initialState = {
  peaks: { loading: true },
  text: { loading: true },
}

export default function siteReducer(state = initialState, action) {
  // console.log(action.type, action)
  // console.log(action.data)
  switch (action.type) {
    case types.peaks.loaded:
      return {
        ...state,
        peaks: action.data,
      }
    case types.text.loaded:
      return {
        ...state,
        text: action.data,
      }
    default:
      return state
  }
}