diff --git a/modules/router-store/src/reducer.ts b/modules/router-store/src/reducer.ts index 53d59fd9f0..4bddc0f000 100644 --- a/modules/router-store/src/reducer.ts +++ b/modules/router-store/src/reducer.ts @@ -1,3 +1,4 @@ +import { Action } from '@ngrx/store'; import { ROUTER_CANCEL, ROUTER_ERROR, @@ -20,15 +21,17 @@ export function routerReducer< T extends BaseRouterStoreState = SerializedRouterStateSnapshot >( state: RouterReducerState | undefined, - action: RouterAction + action: Action ): RouterReducerState { - switch (action.type) { + // Allow compilation with strictFunctionTypes - ref: #1344 + const routerAction = action as RouterAction; + switch (routerAction.type) { case ROUTER_NAVIGATION: case ROUTER_ERROR: case ROUTER_CANCEL: return { - state: action.payload.routerState, - navigationId: action.payload.event.id, + state: routerAction.payload.routerState, + navigationId: routerAction.payload.event.id, }; default: return state as RouterReducerState;