refactored search movie handler function
This commit is contained in:
11
src/store/reducers/reducerSearchMovie.js
Normal file
11
src/store/reducers/reducerSearchMovie.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import { FETCH_SEARCH_MOVIE } from '../actions/index'
|
||||
|
||||
export default function (state = {}, action) {
|
||||
switch (action.type) {
|
||||
case FETCH_SEARCH_MOVIE:
|
||||
const data = action.payload.data.results
|
||||
return { ...state, data }
|
||||
default:
|
||||
return state
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user