vidit-sh / redux-sentry-middleware

Redux middleware for propagating Redux state/actions to use with new @sentry/browser and @sentry/node.
79 stars 16 forks source link

add breadcrumbMessageFromAction #4

Closed xnimorz closed 5 years ago

xnimorz commented 5 years ago

Hello, @vidit-sh

Sometimes it's necessary to use the different message of action breadcrumb instead of action.type.

The most common example is to process batched actions e.g:

{
  type: 'batch',
  payload: [
    {type: 'action-1'}, {type: 'action-2'}
  ]
}

Another use-case is to log actions with a different format e.g.

{
  ID: 123,
  ... 
}

At the moment we have to filter all the breadcrumbs. It would be great if redux-sentry-middleware has such feature from the box. So I have added breadcrumbMessageFromAction which allows defining a function to change a message of action.