Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add breadcrumbMessageFromAction option to handle a message of breadcrumb #98

Merged
merged 2 commits into from
Nov 7, 2018

Conversation

xnimorz
Copy link
Contributor

@xnimorz xnimorz commented Nov 7, 2018

Hello @captbaritone !

Sometimes it's necessary to use the different message of action breadcrumb instead of action.type.
In my project I implemented it, using Raven.dataCallback option. But I have to filter if the breadcrumb is action. It would be great if raven-for-redux have this feature. So I added breadcrumbMessageFromAction that allows defining a function to change a message of action. It could be very useful if we want to handle in Sentry custom actions.

@codecov-io
Copy link

codecov-io commented Nov 7, 2018

Codecov Report

Merging #98 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #98   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          26     28    +2     
  Branches       10     11    +1     
=====================================
+ Hits           26     28    +2
Impacted Files Coverage Δ
index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ab4e52...7ee6daf. Read the comment docs.

@captbaritone
Copy link
Owner

Great idea! A few wording note, but otherwise looks good. If you can make those few changes, I can cut a release later today.

README.md Outdated

Default: `action => action.type`

`breadcrumbMessageFromAction` allows you to specify a transform function which is passed the `action` object and returns a `string` that describes a message of breadcrumb. Which will be logged to Sentry.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about: “That will be used as the message of the breadcrumb.”

README.md Outdated

`breadcrumbMessageFromAction` allows you to specify a transform function which is passed the `action` object and returns a `string` that describes a message of breadcrumb. Which will be logged to Sentry.

By default, `breadcrumbMessageFromAction` will log `action.type` as a `message` of breadcrumb, but you can specify another value.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just “By default breadcrumbMessageFromAction returns action.type.

@xnimorz
Copy link
Contributor Author

xnimorz commented Nov 7, 2018

@captbaritone thank you for the review!
I added fixes in the separated commit 7ee6daf

@captbaritone captbaritone merged commit a3f138b into captbaritone:master Nov 7, 2018
@captbaritone
Copy link
Owner

Thanks! I’ll reply here when I cut the release.

@captbaritone
Copy link
Owner

Just cut 1.4.0 fbe0f54 which includes this feature. Thanks again for the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants