Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. const initialState = {
  2. email:'',
  3. password:'',
  4. status:3
  5. };
  6.  
  7. const AuthReducer = (state = initialState, action) => {
  8.  
  9. switch (action.type) {
  10. case 'changeEmail':
  11. return { ...state, email:action.payload.email};
  12. case 'changePassword':
  13. return { ...state, password:action.payload.password};
  14. case 'changeStatus':
  15. return { ...state, status:action.payload.status };
  16. default:
  17. return initialState;
  18. }
  19.  
  20. }
  21.  
  22. export default AuthReducer;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement