Skip to content

Commit

Permalink
fix(Example): linter problems (#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
tja4472 authored and timdeschryver committed Mar 5, 2019
1 parent 063fbe6 commit 4cfcc08
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exports[`Selected Book Page should compile 1`] = `
>
<bc-book-detail
_nghost-c0=""
ng-reflect-in-collection="false"
>
</bc-book-detail>
Expand Down
2 changes: 1 addition & 1 deletion projects/example-app/src/app/books/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ export const isSelectedBookInCollection = createSelector(
getCollectionBookIds,
getSelectedBookId,
(ids, selected) => {
return selected && ids.indexOf(selected) > -1;
return !!selected && ids.indexOf(selected) > -1;
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class AppComponent {
showSidenav$: Observable<boolean>;
loggedIn$: Observable<boolean>;

constructor(private store: Store<fromRoot.State>) {
constructor(private store: Store<fromRoot.State & fromAuth.State>) {
/**
* Selectors can be applied with the `select` operator which passes the state
* tree to the provided selector
Expand Down
14 changes: 6 additions & 8 deletions projects/example-app/src/app/core/reducers/layout.reducer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
LayoutActions
} from '@example-app/core/actions';
import { Action } from '@ngrx/store';
import { LayoutActions } from '@example-app/core/actions';

export interface State {
showSidenav: boolean;
Expand All @@ -10,11 +9,10 @@ const initialState: State = {
showSidenav: false,
};

export function reducer(
state: State = initialState,
action: LayoutActions.LayoutActionsUnion
): State {
switch (action.type) {
export function reducer(state: State = initialState, action: Action): State {
const specificAction = action as LayoutActions.LayoutActionsUnion;

switch (specificAction.type) {
case LayoutActions.LayoutActionTypes.CloseSidenav:
return {
showSidenav: false,
Expand Down
2 changes: 1 addition & 1 deletion projects/example-app/src/app/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const reducers: ActionReducerMap<State> = {

// console.log all actions
export function logger(reducer: ActionReducer<State>): ActionReducer<State> {
return (state: State, action: any): any => {
return (state, action) => {
const result = reducer(state, action);
console.groupCollapsed(action.type);
console.log('prev state', state);
Expand Down
2 changes: 2 additions & 0 deletions projects/example-app/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"compilerOptions": {
"strict": true,
"strictPropertyInitialization": false,
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"@ngrx/schematics/schematics-core": [
"./modules/schematics/schematics-core"
],
"@example-app/*": ["./projects/example-app/src/app/*"]
"@example-app/*": ["./projects/example-app/src/app/*"],
"ngrx-store-freeze": ["./projects/ngrx-store-freeze"]
}
},
"exclude": [
Expand Down

0 comments on commit 4cfcc08

Please sign in to comment.