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

feat(effect): catch action creators being returned in effect without () #2536

Merged
merged 3 commits into from
May 27, 2020
Merged

feat(effect): catch action creators being returned in effect without () #2536

merged 3 commits into from
May 27, 2020

Conversation

alex-okrushko
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

In #2306 we are catching actionCreators that are not called in store.dispatch(actionCreatorNotCalled) at compile time, however it was still possible to map to ActionCreator in the effects by accident: https://twitter.com/DeborahKurata/status/1263612553067819008

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

We are catching at runtime, which is nice, but we can do better.

Closes #

What is the new behavior?

Catch ActionCreators that are not called at compile time:

effect-catching-action-creator

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Well... somewhat. I needed to adjust the error message and throwError operators (or any other one that returns never) would not be taken any more.

Other information

@ngrxbot
Copy link
Collaborator

ngrxbot commented May 22, 2020

Preview docs changes for 89b509f at https://previews.ngrx.io/pr2536-89b509f/

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

Great!

modules/effects/src/effect_creator.ts Outdated Show resolved Hide resolved
modules/effects/spec/types/effect_creator.spec.ts Outdated Show resolved Hide resolved
@brandonroberts brandonroberts merged commit 100970b into ngrx:master May 27, 2020
BioPhoton pushed a commit to BioPhoton/platform that referenced this pull request Jun 5, 2020
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.

4 participants