-
Notifications
You must be signed in to change notification settings - Fork 0
/
reducers.js
40 lines (34 loc) · 838 Bytes
/
reducers.js
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
import { combineReducers } from 'redux'
import * as types from './types'
const reportReducer = (state = {}, { type, payload }) => {
switch (type) {
case types.LOAD:
return payload;
case types.RESET:
return {};
default:
return state;
}
};
const amznReducer = (state = [], { type, payload }) => {
switch (type) {
case types.AMZNLOAD:
return payload;
default:
return state;
}
};
const filterReducer = (state = {}, { type, payload }) => {
switch (type) {
case types.FILTERCHANGE:
return payload;
default:
return state;
}
};
const reducers = {
orderObj: reportReducer,
amznArray: amznReducer,
filterObj: filterReducer
};
export default combineReducers(reducers)