Created
July 29, 2017 10:32
-
-
Save pawarvijay/e51adbff8989c165f1b29bb06c3eb589 to your computer and use it in GitHub Desktop.
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 from 'immutability-helper'; | |
const testReducer = (state = {}, action) => { | |
switch (action.type) { | |
case 'COMPUTE_AMOUNT': | |
action.paylod.amount = action.paylod.rate * action.paylod.quantity | |
return { ...state, ...action.paylod } | |
default: | |
return state; | |
} | |
} | |
export default testReducer; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment