Created
January 15, 2019 18:25
-
-
Save kumarks1122/b56a2cdc3efa22716e541088a631817e to your computer and use it in GitHub Desktop.
React-Native and Redux Basics - Medium post
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
import { UPDATE_USER_DATA } from '../../helpers/actionTypes'; | |
const defaultState = { | |
currentUserName: "kumar" | |
} | |
export default (state = defaultState, action) => { | |
switch (action.type) { | |
case UPDATE_USER_DATA: | |
return { | |
...state, | |
currentUserName: action.payload | |
}; | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment