How to Integrate a Custom Reducer into Your Website?

How to Integrate a Custom Reducer into Your Website?


You may find the "Custom Reducer Plugin" helpful if you use Redux. This plugin makes it simple to create custom reducers without having to write any custom code. Additionally, it provides an effortless way to manage the state without updating the reducer code manually.

What is a Custom Reducer Plugin?

A Custom Reducer Plugin is used in Redux, a popular state management library in JavaScript. It allows developers to extend or modify the behavior of the Redux store by adding custom logic to the reducer function. This plugin intercepts actions dispatched to the store and provides additional functionality, such as handling specific actions, manipulating the state, or triggering side effects. Custom Reducer Plugins offer a flexible way to customize the behavior of the Redux store and tailor it to specific application requirements.

Installation Guide:

Must check plugin name Spaces


import GstReducer from '../store/Gst/Gst.reducer';

const getStaticReducers = (args, callback, instance) => ({

export default {
   'Store/Index/getReducers': {
       function: getStaticReducers

? You can also get references from the GitHub Helpdesk ScandiPWA here.

? In my store> Gst > Gst.action.js



/** @namespace Store/Gst/Action/updateGstPrice */
export const updateGstPrice = (gst_charge) => ({

? In my store> Gst > Gst.reducer.js


/** @namespace Store/Gst/Reducer/updateGstPrice */
import { UPDATE_GST_PRICE} from './Gst.action';

export const getInitialState = () => ({
     gst_charge : {
           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(),
) => {
   const { type } = action;
   switch (type) {
       const { gst_charge } = action;
       console.log('GstReducer gst_charge',gst_charge)
       return {
       return state;

export default GstReducer;


  • 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

Jayram Prajapati
Full Stack Developer

Jayram Prajapati brings expertise and innovation to every project he takes on. His collaborative communication style, coupled with a receptiveness to new ideas, consistently leads to successful project outcomes.

Most Visited Blog

The Power of Traits in PHP: Simplifying Common Property Injection

Discover the power of PHP Traits! Our guide unveils the potential of characteristics by simplifying property injection and providing a simplified solution to typical code difficulties.

Read More
After move to another server ScandiPWA theme is not responding.

Are you having problems with the ScandiPWA theme after a server migration? To maintain responsiveness and performance on Magento PWA storefront, use our simple guide to effectively troubleshoot.

Read More
How To Create an Extension In PWA studio(Venia)?

Discover the essentials of creating extensions in Venia with our guide. Enhance Magento PWA storefront by developing and implementing extensions that provide capabilities and a personalized user experience.

Read More