Skip to content

Commit

Permalink
fix(router-store): selects should return selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver committed May 7, 2020
1 parent d9c00b7 commit eef5e91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions modules/router-store/spec/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ts_test_library(
"//modules/store",
"@npm//@angular/router",
"@npm//rxjs",
"@npm//ts-snippet",
],
)

Expand Down
17 changes: 9 additions & 8 deletions modules/router-store/src/models.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Data, Params } from '@angular/router';
import { Params, Data } from '@angular/router';
import { MemoizedSelector } from '@ngrx/store';

export interface RouterStateSelectors<V> {
selectCurrentRoute: (state: V) => any;
selectQueryParams: (state: V) => Params;
selectQueryParam: (param: string) => (state: V) => string | undefined;
selectRouteParams: (state: V) => Params;
selectRouteParam: (param: string) => (state: V) => string | undefined;
selectRouteData: (state: V) => Data;
selectUrl: (state: V) => string;
selectCurrentRoute: MemoizedSelector<V, any>;
selectQueryParams: MemoizedSelector<V, Params>;
selectQueryParam: (param: string) => MemoizedSelector<V, string | undefined>;
selectRouteParams: MemoizedSelector<V, Params>;
selectRouteParam: (param: string) => MemoizedSelector<V, string | undefined>;
selectRouteData: MemoizedSelector<V, Data>;
selectUrl: MemoizedSelector<V, string>;
}

0 comments on commit eef5e91

Please sign in to comment.