Skip to content

Instantly share code, notes, and snippets.

@pawarvijay
Created July 29, 2017 10:32
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 pawarvijay/e51adbff8989c165f1b29bb06c3eb589 to your computer and use it in GitHub Desktop.
Save pawarvijay/e51adbff8989c165f1b29bb06c3eb589 to your computer and use it in GitHub Desktop.
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