You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, changes in state will not immediately be reflected in reselect-tools unless selectorGraph() is fired (i.e. on clicking "refresh" in the extension). I've overcome this by adding some redux middleware:
const reselectTools = store => next => action =>{
const nodes = selectorGraph().nodes
let result = next(action)
if (typeof action === "function") return result
const nextNodes = selectorGraph().nodes
const nnKeys = Object.keys(nextNodes) // ["data$", "ui$"]
// log if action changed any selectors
nnKeys.forEach(k=>{
if (nextNodes[k].recomputations!= nodes[k].recomputations) console.log({
...checkSelector(k), action
})
})
return result
}
Now I can at least search in the console for a selector and see the action that triggered it whenever it's recomputed. It'd be great to combine this with the extension search filter.
It seems like this should be the default, or maybe there is a better way to do this? Also, any way to remotely update the extension?
The text was updated successfully, but these errors were encountered:
Hey Matt - your solution looks good to me! Technically this library does not depend on redux, so I'd be reluctant to add any kind of redux-specific middleware. However, this looks like a simple recipe for getting the desired behavior.
I'm not sure I understand your question about 'remotely updating the extension'. Could you clarify?
Currently, changes in state will not immediately be reflected in reselect-tools unless selectorGraph() is fired (i.e. on clicking "refresh" in the extension). I've overcome this by adding some redux middleware:
Now I can at least search in the console for a selector and see the action that triggered it whenever it's recomputed. It'd be great to combine this with the extension search filter.
It seems like this should be the default, or maybe there is a better way to do this? Also, any way to remotely update the extension?
The text was updated successfully, but these errors were encountered: