-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix(store): prevent unexpected behavior of {} as a props type #2728
fix(store): prevent unexpected behavior of {} as a props type #2728
Conversation
Preview docs changes for 9a48cce at https://previews.ngrx.io/pr2728-9a48ccea/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is looking good!
@alex-okrushko can you also give this a look please?
@markostanimirovic it is missing a test at https://github.com/markostanimirovic/platform/blob/fix-payload-type/modules/store/spec/types/action_creator.spec.ts#L14, could you add one please?
@timdeschryver sure |
Hey @markostanimirovic |
I think this solution is better for minor/patch release, because with |
|
@alex-okrushko Yes, I'll do that 👍 EDIT:
So, it's not compatible with interfaces 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
@markostanimirovic I'd argue that they shouldn't be compatible with the interfaces 🙂 Maybe that would be a good breaking (separate) change for the v11! (cc @brandonroberts and @timdeschryver ). Why?
How do you remove it in the reducer? // One might even name it as foo 👇 while in fact it's still an action: foo obj + type prop
on(thingHappened, (state, foo) => ({ ... })) if the on(thingHappened, (state, {type, ...foo}) => ({ ... })) That way type is detached and the actual on(thingHappened, (state, {foo}) => ({ ... })) |
@alex-okrushko Looks good. It will make NGRXers to use the library in the right way 🤘 |
Btw, this is a breaking change (making it stricter). |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior?
Does this PR introduce a breaking change?