Skip to content

Instantly share code, notes, and snippets.

@arunkarnann
Created August 26, 2019 14:37
Show Gist options
  • Save arunkarnann/d767b612cccb526cdea9dfdb3967ce36 to your computer and use it in GitHub Desktop.
Save arunkarnann/d767b612cccb526cdea9dfdb3967ce36 to your computer and use it in GitHub Desktop.
import * as ACTION_TYPES from '../actions/action_types'
const initialState = {
stateprop1 : false
}
const Reducer1 = (state = initialState, action) => {
switch(action.type){
case ACTION_TYPES.SUCCESS:
console.log("In Reducer 1")
return {
...state,
stateprop1: true
}
case ACTION_TYPES.FAILURE:
return{
...state,
stateprop1: false
}
default:
return state
}
}
export default Reducer1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment