File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -16,22 +16,20 @@ export type RouterReducerState<
16
16
} ;
17
17
18
18
export function routerReducer <
19
- T extends BaseRouterStoreState = SerializedRouterStateSnapshot
20
- > (
21
- state : RouterReducerState < T > | undefined ,
22
- action : Action
23
- ) : RouterReducerState < T > {
19
+ RouterState extends BaseRouterStoreState = SerializedRouterStateSnapshot ,
20
+ Result = RouterReducerState < RouterState >
21
+ > ( state : Result | undefined , action : Action ) : Result {
24
22
// Allow compilation with strictFunctionTypes - ref: #1344
25
- const routerAction = action as RouterAction < any , T > ;
23
+ const routerAction = action as RouterAction < any , RouterState > ;
26
24
switch ( routerAction . type ) {
27
25
case ROUTER_NAVIGATION :
28
26
case ROUTER_ERROR :
29
27
case ROUTER_CANCEL :
30
- return {
28
+ return ( {
31
29
state : routerAction . payload . routerState ,
32
30
navigationId : routerAction . payload . event . id ,
33
- } ;
31
+ } as unknown ) as Result ;
34
32
default :
35
- return state as RouterReducerState < T > ;
33
+ return state as Result ;
36
34
}
37
35
}
You can’t perform that action at this time.
0 commit comments