# Redux

> Browse and edit your Redux state, review every action with a diff, time travel, and dispatch actions from the desktop app. It is off until you pass your store.

The Redux panel has three tabs. **State** shows your store’s current state and lets you edit its values. **Actions** lists every action with a diff, and can unwind the store to any of them. **Dispatch** sends an action with a payload you enter.

[Setting up Redux in the SDK](/docs/sdk/redux/)

![The Redux panel's State tab with a nested object expanded](/_astro/redux-state-light.5zWx_HiH_Zylu9u.webp)![The Redux panel's State tab with a nested object expanded](/_astro/redux-state-dark.DhK4B6p7_Z1GGNi.webp)

The Redux panel's State tab with a nested object expanded

## Using the Redux panel

### Browsing state

The **State** tab shows your store’s state as a tree. Use **Expand all** and **Collapse all** to open or close every branch, and **Copy** to copy the whole state as JSON.

Values that aren’t JSON are shown as text: a function as `ƒ name()`, a `Date` as an ISO string, and `undefined` as `undefined`. A `Map` shows as an object and a `Set` as an array.

### Filtering state

Type in **Filter state…** to find keys and values that contain the text, ignoring case. Matches are highlighted and their branches open.

Type a full path, such as `case.caseNumber`, to show only that value. Array items are numbered, as in `suspects.names.0`. As you type a path, the keys at that level are suggested.

### Editing values

Double-click a string, number, boolean or `null` to edit it, or tab to it and press `Enter`. A string takes any text. Other values take a JSON value, so to change a number into a string, type it in quotes.

Hover an array to change its items:

* **Add item** on the array adds an item at the start.
* **Add item after…** on an item adds one after it.
* **Remove item** removes the item.

When you add an item, choose **String**, **Number**, **Boolean** or **Null**, then edit its value. Keys can’t be added to or removed from objects, and functions and other non-JSON values can’t be edited.

Each edit replaces the state in your app without running your reducers, and appears in **Actions** as `@@xerlock/edit`.

### Reviewing actions

![The Actions tab with an action selected and its diff open in the details pane](/_astro/redux-actions-light.BG5IM_Ri_2raMEJ.webp)![The Actions tab with an action selected and its diff open in the details pane](/_astro/redux-actions-dark.Dj9vy7hn_Z1bp7YT.webp)

The Actions tab with an action selected and its diff open in the details pane

The **Actions** tab lists every action, with the newest at the bottom. Each shows its time, its type in bold, a summary of its payload, and how long it took. The list follows new actions while you’re scrolled to the bottom.

Type in **Filter actions…** to show actions whose type or payload contains the text, ignoring case. **Filter by type** lists every type in the log with its count. Turn a type off to hide it, or click **Show all**. While a filter hides actions, **Clear filters** shows them again. **Clear actions** empties the list.

Select an action to open it:

* **Diff** lists each value that was **Added**, **Removed** or **Changed**, with its before and after values.
* **Before** and **After** show the whole state either side of the action.
* **Payload** shows the action itself.

The list is kept when your app reloads. Before and after states are kept for the last 200 actions, and only until your app reloads or reconnects. For other actions, the pane shows “State for this change is no longer available.”

### Time travel

**Unwind to here**, on an action or in its details pane, returns the store to its state right after the action. Later actions are removed from the list, and the unwind isn’t added as an action.

Caution

Unwinding only replaces the store’s state. It doesn’t undo anything else your app did, such as requests it sent. It can’t be undone.

### Dispatching actions

![The Dispatch tab with an action type selected, its payload prefilled, and a recent dispatch listed](/_astro/redux-dispatch-light._3tUcZc7_Z1sTFlR.webp)![The Dispatch tab with an action type selected, its payload prefilled, and a recent dispatch listed](/_astro/redux-dispatch-dark.BYhQeZFn_1xEFwJ.webp)

The Dispatch tab with an action type selected, its payload prefilled, and a recent dispatch listed

On the **Dispatch** tab, choose a type in **Select an action type…**, or type a new one and choose **Use ‘…’**. Types from [`actions`](#offering-actions-to-dispatch) are marked **registered**, and those with a `dispatchable()` template are marked **template**. Types from the log show how many times they were dispatched.

Choosing a type fills the editor with its template, or with the payload of its last action in the log. Edit the rest of the action as a JSON object without `type`, such as `{ "payload": "Irene Adler" }`. An empty editor sends just the type. Then click **Dispatch**.

You’ll see “Dispatched …” and the action appears in **Actions**. If a reducer or middleware throws, you’ll see “Couldn’t dispatch the action” instead.

**Recent dispatches** lists the last 10 successful dispatches. **Dispatch again** repeats one, and **Edit** loads it into the editor.

## Limits and Troubleshooting

* Xerlock shows one Redux store per app.
* Before and after states are kept for the last 200 actions. Older actions can’t be diffed or unwound to.
