Skip to content

Instantly share code, notes, and snippets.

@UberMouse
Created July 3, 2017 21:18
Show Gist options
  • Save UberMouse/6f986f24d97f37cb15db9eddfd545419 to your computer and use it in GitHub Desktop.
Save UberMouse/6f986f24d97f37cb15db9eddfd545419 to your computer and use it in GitHub Desktop.
Log Raygun4JS Breadcrumbs from Redux actions
const breadcrumbMiddleware = store => next => action => {
const previousState = store.getState();
const nextAction = next(action);
const state = store.getState();
rg4js('recordBreadcrumb', {
message: `Executing Redux action '${action.type}'`,
metadata: {
action,
state,
previousState
},
level: 'info'
});
return nextAction;
};
export default breadcrumbMiddleware;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment