Has someone successfully integrated with Redux Dev...
# javascript
p
Has someone successfully integrated with Redux Dev Tools? I'm trying to do this, but it breaks my app.
Copy code
createStore(
    reducers,
    jsObject(),
    compose(
        rEnhancer()
    ) {
        if (window.asDynamic().__REDUX_DEVTOOLS_EXTENSION__) {
            window.asDynamic().__REDUX_DEVTOOLS_EXTENSION__()
        } else {
            it
        }
    }
)
b
KT.js doesn't have a concept of "falsy" it's either pure true or pure false
so your if statement needs
window.asDynamic().__REDUX_DEVTOOLS_EXTENSION__ != undefined
If you're looking for examples, kvision-redux module integrates with redux devtools
p
I think the
if
is ok. When I change the name to some garbage, it gets to the
false
branch and my app works. So, it successfully detects the installed extension.
But thanks for the tip, I'll look at kVision.
p
Copy code
if (window.asDynamic().__REDUX_DEVTOOLS_EXTENSION__) {
    compose(rEnhancer(), window.asDynamic().__REDUX_DEVTOOLS_EXTENSION__())
} else {
    rEnhancer()
}