captbaritone / raven-for-redux

A Raven middleware for Redux
295 stars 25 forks source link

Add filterBreadcrumbActions option #39

Closed bjudson closed 7 years ago

bjudson commented 7 years ago

filterBreadcrumbActions is a function that returns true if an action should be added to the breadcrumbs.

The rationale for this is that some Redux apps use some actions internally to trigger state changes that are both prolific and not directly connected to user behavior. They can overwhelm the logs and have essentially no value for debugging purposes.

codecov-io commented 7 years ago

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #39   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          18     21    +3     
  Branches        6      8    +2     
=====================================
+ Hits           18     21    +3
Impacted Files Coverage Δ
index.js 100% <100%> (ø) :arrow_up:

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 94272f0...3a61ff2. Read the comment docs.

captbaritone commented 7 years ago

How about instead of an array of types, we allow the user to supply a filterBreadcrumbActions function?

Also, I think the action should still be set as the lastAction even if it has been filtered out. Could you add a test to confirm that?

Thanks for the PR, I think this will be a great improvement.

bjudson commented 7 years ago

@captbaritone Good idea. Updated PR with your suggestion. The test I added now confirms that the filtered action was omitted from breadcrumbs, but still included in lastAction. Thanks!

captbaritone commented 7 years ago

Looks good! I'll cut a point release.

bjudson commented 7 years ago

Thanks for the quick feedback & merge! This is definitely going to improve our debugging process.

captbaritone commented 7 years ago

Okay. Should be available in v1.1.0

Thanks again for your work on this!