Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add filterBreadcrumbActions option#39

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
captbaritone merged 6 commits intocaptbaritone:masterfrombjudson:master
Oct 3, 2017

Conversation

@bjudson
Copy link
Contributor

@bjudsonbjudson commentedOct 3, 2017
edited
Loading

filterBreadcrumbActions is a function that returnstrue 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
Copy link

codecov-io commentedOct 3, 2017
edited
Loading

Codecov Report

Merging#39 intomaster willnot change coverage.
The diff coverage is100%.

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 FilesCoverage Δ
index.js100% <100%> (ø)⬆️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update94272f0...3a61ff2. Read thecomment docs.

captbaritone reacted with heart emoji

@captbaritone
Copy link
Owner

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

Also, I think the action should still be set as thelastAction 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.

@bjudsonbjudson changed the titleAdd ignoreActions optionAdd filterBreadcrumbActions optionOct 3, 2017
@bjudson
Copy link
ContributorAuthor

@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!

index.js Outdated
message:action.type,
data:breadcrumbDataFromAction(action)
});
if(filterBreadcrumbActions(action)===true){

Choose a reason for hiding this comment

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

I think it would be less confusing for this to just check for truthy values.

if (filterBreadcrumbActions(action)) {

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Yeah, I did that at first, but thought being explicit might catch some bugs in the user-supplied function.

Choose a reason for hiding this comment

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

I think truths/falsy is a perfectly valid return value from a filter predicate. Not nessesarily a bug.

bjudson reacted with thumbs up emoji
given the category`"redux-action"`. If you would prefer a different category
name, specify it here.

####`filterBreadcrumbActions`_(Function)_

Choose a reason for hiding this comment

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

This might also be worth adding to the "improvements" section above.

Copy link
Owner

@captbaritonecaptbaritone left a comment

Choose a reason for hiding this comment

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

Just one small thing. Thanks for the quick turn around.

extra,
breadcrumbs
}=context.mockTransport.mock.calls[0][0].data;
// Even though the action isn't added to breadcrumbs, it should be sent with extra data

Choose a reason for hiding this comment

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

I think this would be better as a separateit() block, that way if it fails, we get a nice error message, but don't worry about it. I can always clean this up later.

@captbaritonecaptbaritone merged commite09114d intocaptbaritone:masterOct 3, 2017
@captbaritone
Copy link
Owner

Looks good! I'll cut a point release.

@bjudson
Copy link
ContributorAuthor

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

captbaritone reacted with hooray emoji

@captbaritone
Copy link
Owner

Okay. Should be available in v1.1.0

Thanks again for your work on this!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@captbaritonecaptbaritonecaptbaritone requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@bjudson@codecov-io@captbaritone

[8]ページ先頭

©2009-2025 Movatter.jp