Skip to content

Commit 0407c5b

Browse files
timdeschryverbrandonroberts
authored andcommitted
fix(router-store): remove circular dependency in serializers (#1904)
Closes #1902
1 parent 75987a6 commit 0407c5b

File tree

9 files changed

+19
-29
lines changed

9 files changed

+19
-29
lines changed

modules/router-store/src/actions.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ import {
66
RoutesRecognized,
77
} from '@angular/router';
88

9-
import {
10-
BaseRouterStoreState,
11-
SerializedRouterStateSnapshot,
12-
} from './serializers';
9+
import { BaseRouterStoreState } from './serializers/base';
10+
import { SerializedRouterStateSnapshot } from './serializers/default_serializer';
1311

1412
/**
1513
* An action dispatched when a router navigation request is fired.

modules/router-store/src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ export {
2828
} from './router_store_module';
2929
export {
3030
RouterStateSerializer,
31+
BaseRouterStoreState,
32+
} from './serializers/base';
33+
export {
3134
DefaultRouterStateSerializer,
3235
SerializedRouterStateSnapshot,
33-
BaseRouterStoreState,
36+
} from './serializers/default_serializer';
37+
export {
3438
MinimalActivatedRouteSnapshot,
3539
MinimalRouterStateSnapshot,
3640
MinimalRouterStateSerializer,
37-
} from './serializers';
41+
} from './serializers/minimal_serializer';
3842
export { getSelectors } from './router_selectors';

modules/router-store/src/reducer.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ import {
55
ROUTER_NAVIGATION,
66
RouterAction,
77
} from './actions';
8-
import {
9-
BaseRouterStoreState,
10-
SerializedRouterStateSnapshot,
11-
} from './serializers';
8+
import { BaseRouterStoreState } from './serializers/base';
9+
import { SerializedRouterStateSnapshot } from './serializers/default_serializer';
1210

1311
export type RouterReducerState<
1412
T extends BaseRouterStoreState = SerializedRouterStateSnapshot

modules/router-store/src/router_selectors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { RouterReducerState } from '@ngrx/router-store';
21
import { createSelector } from '@ngrx/store';
32
import { RouterStateSelectors } from './models';
3+
import { RouterReducerState } from './reducer';
44

55
export function getSelectors<V>(
66
selectState: (state: V) => RouterReducerState<any>

modules/router-store/src/router_store_module.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ import {
2727
} from './actions';
2828
import { RouterReducerState } from './reducer';
2929
import {
30-
DefaultRouterStateSerializer,
3130
RouterStateSerializer,
32-
SerializedRouterStateSnapshot,
3331
BaseRouterStoreState,
34-
MinimalRouterStateSerializer,
35-
} from './serializers';
32+
} from './serializers/base';
33+
import {
34+
DefaultRouterStateSerializer,
35+
SerializedRouterStateSnapshot,
36+
} from './serializers/default_serializer';
37+
import { MinimalRouterStateSerializer } from './serializers/minimal_serializer';
3638

3739
export type StateKeyOrSelector<
3840
T extends BaseRouterStoreState = SerializedRouterStateSnapshot

modules/router-store/src/serializers/default_serializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
2-
import { BaseRouterStoreState, RouterStateSerializer } from './shared';
2+
import { BaseRouterStoreState, RouterStateSerializer } from './base';
33

44
export interface SerializedRouterStateSnapshot extends BaseRouterStoreState {
55
root: ActivatedRouteSnapshot;

modules/router-store/src/serializers/index.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

modules/router-store/src/serializers/minimal_serializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router';
2-
import { BaseRouterStoreState, RouterStateSerializer } from './shared';
2+
import { BaseRouterStoreState, RouterStateSerializer } from './base';
33

44
export interface MinimalActivatedRouteSnapshot {
55
routeConfig: ActivatedRouteSnapshot['routeConfig'];

0 commit comments

Comments
 (0)