-
-
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
feat(RouterStore): add routerState to action payload #1511
Conversation
modules/router-store/src/actions.ts
Outdated
@@ -19,16 +19,19 @@ export const ROUTER_REQUEST = '@ngrx/router-store/request'; | |||
/** | |||
* Payload of ROUTER_REQUEST | |||
*/ | |||
export type RouterRequestPayload = { | |||
export type RouterRequestPayload<T extends BaseRouterStoreState> = { |
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.
Won't this be breaking if no default is provided?
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.
You're right, this is a breaking change - the type needs to be there.
modules/router-store/src/actions.ts
Outdated
@@ -112,16 +115,19 @@ export const ROUTER_NAVIGATED = '@ngrx/router-store/navigated'; | |||
/** | |||
* Payload of ROUTER_NAVIGATED. | |||
*/ | |||
export type RouterNavigatedPayload = { | |||
export type RouterNavigatedPayload<T extends BaseRouterStoreState> = { |
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.
Same
@@ -302,7 +300,13 @@ export class StoreRouterConnectingModule { | |||
private dispatchRouterAction(type: string, payload: any): void { |
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.
Will you check to see how we can improve the signature for this function? payload: any
could be RouterEvent
at a minimum I think.
eedb0bf
to
7152ccf
Compare
7152ccf
to
81c05e4
Compare
Preview docs changes for 7152ccf at https://previews.ngrx.io/pr1511-7152ccf/ |
Preview docs changes for 81c05e4 at https://previews.ngrx.io/pr1511-81c05e4/ |
@timdeschryver is this ready for another review? Some of the defaults are still missing for the types. |
Preview docs changes for 5c2476f at https://previews.ngrx.io/pr1511-5c2476f/ |
@brandonroberts I just added the defaults. |
Hey @timdeschryver
Should the |
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?
Only the
RouterNavigationAction
,RouterCancelAction
andRouterErrorAction
events had therouterState
property in the payload.Closes #1509
What is the new behavior?
All of the router events will have the
routerState
property in the payload.The
routerState
property is added toRouterRequestAction
andRouterNavigatedAction
Does this PR introduce a breaking change?
Other information
These actions were introduced in #1267 and I couldn't find why the
routerState
property isn't added. The rest of the actions had this property from version 4.0.0.