Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import * as t from './constants';
  2.  
  3. let initialState = { data:[] };
  4.  
  5. const dataReducer = (state = initialState, action) => {
  6. switch (action.type) {
  7. case t.DATA_AVAILABLE:{
  8. let { data } = action;
  9.  
  10. return {...state, data};
  11. }
  12. default:
  13. return state;
  14.  
  15. }
  16. };
  17.  
  18. export default dataReducer;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement