github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/build-blockchain-insurance-app-master/web/src/shop/reducers/shopReducer.js (about) 1 'use strict'; 2 3 import * as ShopActionType from '../actions/shopActionTypes'; 4 import * as initialState from './initialState'; 5 6 export default function shopReducer(state = initialState.shop, action) { 7 switch (action.type) { 8 case ShopActionType.SET_SHOP_TYPE: 9 return Object.assign({}, state, 10 { type: action.shopType, products: [...action.products] }); 11 case ShopActionType.SUBMIT_PRODUCT: 12 return Object.assign({}, state, 13 { productInfo: action.productInfo }); 14 default: 15 return state; 16 } 17 }