File size: 398 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import SearchActionTypes from "./search-types";

const INITIAL_STATE = {
  searchItems: []
};

const searchReducer = (state = INITIAL_STATE, action) => {
  const { type, payload } = action;
  switch (type) {
    case SearchActionTypes.SET_SEARCH_DATA: {
      return { ...state, searchItems: payload };
    }
    default:
      return state;
  }
};

export default searchReducer;