implemented redux for state management
This commit is contained in:
11
src/store/reducers/reducerDocumentary.js
Normal file
11
src/store/reducers/reducerDocumentary.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import { FETCH_DOCUMENTARIES } from '../actions/index';
|
||||
|
||||
export default function (state = {}, action) {
|
||||
switch (action.type) {
|
||||
case FETCH_DOCUMENTARIES:
|
||||
const data = action.payload.data.results;
|
||||
return { ...state, data }
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user