> For the complete documentation index, see [llms.txt](https://docs.navigaglobal.com/dashboard-plugin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.navigaglobal.com/dashboard-plugin/api-and-gui/api/register/reducers.md).

# Reducers

Dashboard uses [redux](https://redux.js.org/) for state management. This mean you also can register your state into the Dashboard management in order to keep a state when swapping workspaces and an unmount of your application is happening.

#### example

> Registering a plugin with reducers.

```javascript
import DashboardPlugin from 'Dashboard/plugin'

import search from 'reducers/search'
import navigations from 'reducers/navigations'

const Plugin = new DashboardPlugin('@plugin_bundle')

const registerPlugin = () => {
    const { Application } = require('@components/Application')
    
    Plugin.register({
        application: Application,

        reducers: {
    	    search,
    	    navigations,
        }
    })
}

registerPlugin()

export {
    Plugin
}
```

> The idea behind registering reducers with Dashboard is when your Application is unmounted by switching to another workspace for example, Dashboard will hold your store state, so when your Application mounts again it can display the previous state.

By default your store will be shared with all your Dashboard components and can be accessed from the props, so if you have two Applications in the same workspace, they both will have the same store, it means any changes on the state it will effect the other, that applies to the Widget if it has been registered as well!

You can disable sharing your store so each Application will have their own store by passing `sharedReducers: false` with the register method.

#### example

> Registering a plugin with un-shared reducers.

```javascript
import DashboardPlugin from 'Dashboard/plugin'

import search from 'reducers/search'
import navigations from 'reducers/navigations'

const Plugin = new DashboardPlugin('@plugin_bundle')

const registerPlugin = () => {
    const { Application } = require('@/Application')
    
    Plugin.register({
        application: Application,

        reducers: {
    	    search,
    	    navigations,
        },
        
        sharedReducers: false
    })
}

registerPlugin()

export {
    Plugin
}
```

You can also apply your own middleware as an Array with the register method

#### example

> Registering a plugin with un-shared reducers and with a custom middleware.

```javascript
import DashboardPlugin from 'Dashboard/plugin'

import search from 'reducers/search'
import navigations from 'reducers/navigations'

import cacheMiddleware from 'middlewares/cache'

const Plugin = new DashboardPlugin('@plugin_bundle')

const registerPlugin = () => {
    const { Application } = require('@/Application')
    
    Plugin.register({
        application: Application,

        reducers: {
    	    search,
    	    navigations,
        },
        
        sharedReducers: false,

        middlewares: [
    	    cacheMiddleware
        ]
    })
}

registerPlugin()

export {
    Plugin
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.navigaglobal.com/dashboard-plugin/api-and-gui/api/register/reducers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
