blob: 102498d5c0a5d9851b442a9fce51789a8ed36669 (
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
|
import * as types from '../../types'
// import { session, getDefault, getDefaultInt } from '../../session'
import { crudState, crudReducer } from '../../api/crud.reducer'
const initialState = crudState('tile', {
temporaryTile: null,
})
const reducer = crudReducer('tile')
export default function tileReducer(state = initialState, action) {
// console.log(action.type, action)
state = reducer(state, action)
switch (action.type) {
case types.tile.update_temporary_tile:
return {
...state,
temporaryTile: action.data
}
case types.tile.remove_temporary_tile:
return {
...state,
temporaryTile: null
}
default:
return state
}
}
|