Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. @Component({
  2. selector: 'commits-with-ngrx',
  3. templateUrl: './commits-with-ngrx.component.html',
  4. styleUrls: ['./commits-with-ngrx.component.scss'],
  5. changeDetection: ChangeDetectionStrategy.OnPush
  6. })
  7. export class CommitsWithNgrxComponent {
  8.  
  9. commits$: Observable<Commit[]>;
  10. commitsFailures$: Observable<Failure[]>;
  11.  
  12. constructor(private store: Store<AppState>) {
  13. this.commits$ = this.store.select(commits);
  14. this.commitsFailures$ = this.store.select(commitsFailuerState);
  15. }
  16.  
  17. search(username) {
  18. this.store.dispatch(new LoadCommits({ username }));
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement