Last active
September 27, 2020 15:20
-
-
Save surfer19/050b786d61f77c503f0fb871b7aa7d65 to your computer and use it in GitHub Desktop.
global-context.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// context/global-context.jsx | |
export const reducer = (state, action) => { | |
switch (action.type) { | |
case "SAVE_LOGIN_INFO": | |
return { | |
...state, | |
email: action.email, | |
password: action.password | |
}; | |
case "SAVE_PERSONAL_INFO": | |
return { | |
...state, | |
firstName: action.firstName, | |
surname: action.surname | |
}; | |
default: | |
return { | |
...state | |
}; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment