added tests for hostReducer and Header Effects, and switch to typed actions

This commit is contained in:
Art Lowel
2017-01-13 11:25:07 +01:00
parent dba6dcec63
commit 8e4bec9c30
13 changed files with 211 additions and 82 deletions

View File

@@ -1,9 +1,12 @@
import { Component, OnInit } from "@angular/core";
import { Store } from "@ngrx/store";
import { HeaderState } from "./header.reducer";
import { HeaderActions } from "./header.actions";
import { Observable } from "rxjs";
import 'rxjs/add/operator/filter';
import {
HeaderCollapseAction,
HeaderExpandAction,
HeaderToggleAction
} from "./header.actions";
@Component({
selector: 'ds-header',
@@ -25,15 +28,15 @@ export class HeaderComponent implements OnInit {
}
private collapse(): void {
this.store.dispatch(HeaderActions.collapse());
this.store.dispatch(new HeaderCollapseAction());
}
private expand(): void {
this.store.dispatch(HeaderActions.expand());
this.store.dispatch(new HeaderExpandAction());
}
public toggle(): void {
this.store.dispatch(HeaderActions.toggle());
this.store.dispatch(new HeaderToggleAction());
}
}