Skip to content

Instantly share code, notes, and snippets.

@kumarks1122
Created January 15, 2019 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumarks1122/b56a2cdc3efa22716e541088a631817e to your computer and use it in GitHub Desktop.
Save kumarks1122/b56a2cdc3efa22716e541088a631817e to your computer and use it in GitHub Desktop.
React-Native and Redux Basics - Medium post
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