Setup

Debuging is disabled by default and can be invoked via console see more on Automated Changes Output

Debugger setup

However, often there are cases, when you need to track whole state change history from very start for example initial data load etc. For this case you can enable it on app initialization:

ReactState
    .debugger(true, { enableConsoleOutput: false })
    .init((routerHistory: History) => {
        hydrate(<Main history={routerHistory} />, document.getElementById("example"))
    }, initialState, isProd);

As you can see there are more options:

  • enableConsoleOutput - toggle output changes to console or not

  • enableDevToolsOutput - toggle output changes to Redux DevTools or not

History options

react-state-rxjs keeps 100 latest history items by default. It can be useful when you want to send some logs for further investigation. You can disable or increase stored items by overriding default parameters by invoking changeHistoryDefaultOptions

ReactState
    .changeHistoryDefaultOptions({ collectHistory: false })
    .init((routerHistory: History) => {
        hydrate(<Main history={routerHistory} />, document.getElementById("example"))
    }, initialState, isProd);

it has such options:

  • storeHistoryItems - number of items to store

  • collectHistory - enable or disable history collecting

Last updated