Skip to content

Instantly share code, notes, and snippets.

@bjudson
Last active April 18, 2018 07:43
Show Gist options
  • Save bjudson/23664cf660b0a6b1e8cbe05ec1339aa2 to your computer and use it in GitHub Desktop.
Save bjudson/23664cf660b0a6b1e8cbe05ec1339aa2 to your computer and use it in GitHub Desktop.
raven for redux middleware config
import createRavenMiddleware from "raven-for-redux";
export default createRavenMiddleware(window.Raven, {
stateTransformer: function(state) {
return Object.assign({}, state, {
entities: flattenEntities(state.entities)
});
},
actionTransformer: function(action) {
if (action.response && action.response.entities) {
return Object.assign({}, action, {
response: Object.assign({}, action.response, {
entities: flattenEntities(action.response.entities)
})
});
}
return action;
},
filterBreadcrumbActions: function(action) {
return !breadcrumbActionBlacklist.includes(action.type);
}
});
@jorendemaeyer1996
Copy link

Can you also show your flattenEntities function please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment