Redux-devtools: Include expandable stack-trace for actions, in the "Inspector" tab

Created on 16 Jun 2017  路  2Comments  路  Source: reduxjs/redux-devtools

This is a feature proposal, similar to: https://github.com/evgenyrodionov/redux-logger/issues/158

Most helpful comment

For others wanting this behavior, this is the workaround I'm currently using:

    const store = createStore(
        [...]
        compose(
            [...]
            applyMiddleware([
                store=>next=>action=> {
                    // add stack, so we can inspect in redux-devtools
                    action["stack"] = new Error().stack.split("\n").slice(1);
                    const returnValue = next(action);
                    return returnValue;
                },
            ]),
        )
    );

The result (make sure you open the "Action" panel, rather than the "Diff" panel):

All 2 comments

For others wanting this behavior, this is the workaround I'm currently using:

    const store = createStore(
        [...]
        compose(
            [...]
            applyMiddleware([
                store=>next=>action=> {
                    // add stack, so we can inspect in redux-devtools
                    action["stack"] = new Error().stack.split("\n").slice(1);
                    const returnValue = next(action);
                    return returnValue;
                },
            ]),
        )
    );

The result (make sure you open the "Action" panel, rather than the "Diff" panel):

We finally implemented that in 2.17.0. Thanks for the suggestion!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Patrik-Lundqvist picture Patrik-Lundqvist  路  10Comments

mauron85 picture mauron85  路  7Comments

Anahkiasen picture Anahkiasen  路  11Comments

lcxfs1991 picture lcxfs1991  路  10Comments

wldcordeiro picture wldcordeiro  路  4Comments