Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Logging middleware for Redux.
Logging middleware for Redux as suggested by the official documentation.
export const logger = store => next => action => {
console.log('dispatching\n', action)
let result = next(action)
console.log('next state\n', store.getState())
return result
export const crashReporter = store => next => action => {
try {
return next(action)
} catch (err) {
console.error('Caught an exception!', err)
Raven.captureException(err, {
extra: {
state: store.getState()
throw err
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.