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(store): add protection from type property use #1923

Merged
merged 2 commits into from
Jun 6, 2019
Merged

feat(store): add protection from type property use #1923

merged 2 commits into from
Jun 6, 2019

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?

[ ] 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?

actions creators could use type property, even thought it would be overridden.

export const a = createAction('my action', props<{type: string}>());

Closes #1917

What is the new behavior?

Such usage will produce the error:

  • with creator function
Type '{ type: string; }' is not assignable to type '"type property is not allowed in action creators"
  • with props
Argument of type '"type property is not allowed in action creators"' is not assignable to parameter of type...

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@ngrxbot
Copy link
Collaborator

ngrxbot commented Jun 6, 2019

Preview docs changes for e3e2d04 at https://previews.ngrx.io/pr1923-e3e2d04/

@ngrxbot
Copy link
Collaborator

ngrxbot commented Jun 6, 2019

Preview docs changes for 97fe805 at https://previews.ngrx.io/pr1923-97fe805/

@brandonroberts brandonroberts merged commit bb9add7 into ngrx:master Jun 6, 2019
@alex-okrushko alex-okrushko deleted the disallow-type branch October 30, 2019 03:01
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.

RFC: Disallow type to be passed to props of action creators
3 participants