? In my store> Gst > Gst.reducer.js
js
/** @namespace Store/Gst/Reducer/updateGstPrice */
import { UPDATE_GST_PRICE} from './Gst.action';
export const getInitialState = () => ({
gst_charge : {
subtotal_excl_cgst_charge:0,
subtotal_excl_sgst_charge: 0,
subtotal_excl_igst_charge: 0,
shipping_excl_cgst_charge: 0,
shipping_excl_sgst_charge: 0,
shipping_excl_igst_charge: 0,
subtotal_incl_cgst_charge: 0,
subtotal_incl_sgst_charge: 0,
subtotal_incl_igst_charge: 0,
shipping_incl_cgst_charge: 0,
shipping_incl_sgst_charge: 0,
shipping_incl_igst_charge: 0,
}
});
/** @namespace Store/Gst/Reducer/updateGstPrice */
export const GstReducer = (
state = getInitialState(),
action
) => {
const { type } = action;
switch (type) {
case UPDATE_GST_PRICE:
const { gst_charge } = action;
console.log('GstReducer gst_charge',gst_charge)
return {
...state,
gst_charge
};
default:
return state;
}
};
export default GstReducer;
Conclusion:
- You can use custom reducer plugins to modify the results of a specific data reduction tool. Plugins must be downloaded from a trusted source and installed to work correctly.
- The benefits of using a custom reducer plugin include increased flexibility, improved accuracy, and the ability to customize the output.
Contact us:+91 8128405131
Email send us at hello@elightwalk.com