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