Skip to content

Commit

Permalink
fix(router-store): remove circular dependency in serializers (#1904)
Browse files Browse the repository at this point in the history
Closes #1902
  • Loading branch information
timdeschryver authored and brandonroberts committed Jun 1, 2019
1 parent 75987a6 commit 0407c5b
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 29 deletions.
6 changes: 2 additions & 4 deletions modules/router-store/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import {
RoutesRecognized,
} from '@angular/router';

import {
BaseRouterStoreState,
SerializedRouterStateSnapshot,
} from './serializers';
import { BaseRouterStoreState } from './serializers/base';
import { SerializedRouterStateSnapshot } from './serializers/default_serializer';

/**
* An action dispatched when a router navigation request is fired.
Expand Down
8 changes: 6 additions & 2 deletions modules/router-store/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ export {
} from './router_store_module';
export {
RouterStateSerializer,
BaseRouterStoreState,
} from './serializers/base';
export {
DefaultRouterStateSerializer,
SerializedRouterStateSnapshot,
BaseRouterStoreState,
} from './serializers/default_serializer';
export {
MinimalActivatedRouteSnapshot,
MinimalRouterStateSnapshot,
MinimalRouterStateSerializer,
} from './serializers';
} from './serializers/minimal_serializer';
export { getSelectors } from './router_selectors';
6 changes: 2 additions & 4 deletions modules/router-store/src/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import {
ROUTER_NAVIGATION,
RouterAction,
} from './actions';
import {
BaseRouterStoreState,
SerializedRouterStateSnapshot,
} from './serializers';
import { BaseRouterStoreState } from './serializers/base';
import { SerializedRouterStateSnapshot } from './serializers/default_serializer';

export type RouterReducerState<
T extends BaseRouterStoreState = SerializedRouterStateSnapshot
Expand Down
2 changes: 1 addition & 1 deletion modules/router-store/src/router_selectors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RouterReducerState } from '@ngrx/router-store';
import { createSelector } from '@ngrx/store';
import { RouterStateSelectors } from './models';
import { RouterReducerState } from './reducer';

export function getSelectors<V>(
selectState: (state: V) => RouterReducerState<any>
Expand Down
10 changes: 6 additions & 4 deletions modules/router-store/src/router_store_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ import {
} from './actions';
import { RouterReducerState } from './reducer';
import {
DefaultRouterStateSerializer,
RouterStateSerializer,
SerializedRouterStateSnapshot,
BaseRouterStoreState,
MinimalRouterStateSerializer,
} from './serializers';
} from './serializers/base';
import {
DefaultRouterStateSerializer,
SerializedRouterStateSnapshot,
} from './serializers/default_serializer';
import { MinimalRouterStateSerializer } from './serializers/minimal_serializer';

export type StateKeyOrSelector<
T extends BaseRouterStoreState = SerializedRouterStateSnapshot
Expand Down
2 changes: 1 addition & 1 deletion modules/router-store/src/serializers/default_serializer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { BaseRouterStoreState, RouterStateSerializer } from './shared';
import { BaseRouterStoreState, RouterStateSerializer } from './base';

export interface SerializedRouterStateSnapshot extends BaseRouterStoreState {
root: ActivatedRouteSnapshot;
Expand Down
12 changes: 0 additions & 12 deletions modules/router-store/src/serializers/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion modules/router-store/src/serializers/minimal_serializer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router';
import { BaseRouterStoreState, RouterStateSerializer } from './shared';
import { BaseRouterStoreState, RouterStateSerializer } from './base';

export interface MinimalActivatedRouteSnapshot {
routeConfig: ActivatedRouteSnapshot['routeConfig'];
Expand Down

0 comments on commit 0407c5b

Please sign in to comment.