reduxjs / redux-devtools

DevTools for Redux with hot reloading, action replay, and customizable UI
http://youtube.com/watch?v=xsSnOQynTHs
MIT License
14.05k stars 1.16k forks source link

Remember preference for recording rather than always defaulting to on #1785

Closed kevinschaich closed 2 hours ago

kevinschaich commented 2 hours ago

I have a large object that tends to make Redux Devtools really unhappy and also makes my app unresponsive.

I spent quite a while debugging my actual app only to discover that it's actually the devtools recording state diffs that is causing the performance issues.

I'd like them to respect my decision to record or not record state transitions, or alternatively; only record when the devtools themselves are open, similar to the functionality of Chrome's Network tab.

Right now, if I turn recording off, then refresh the page (or my Next app hot reloads), recording is then turned on again automatically and the problem persists.

Let me know if I'm missing a preference or configuration somewhere.

kevinschaich commented 2 hours ago

I apologize – I'm using another framework that implements the Redux Devtools protocol but the TypeScript types are not exported correctly – so the available options were not displaying in my IDE.

The autoPause config option is exactly what I'm looking for. Thanks for an incredible tool!

import type { Config as ReduxDevtoolsConfig } from '@redux-devtools/extension'

export const store = create(
    devtools(
        { ... },
        { autoPause: true } as ReduxDevtoolsConfig
    )
)