Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Component({
- selector: 'commits-with-ngrx',
- templateUrl: './commits-with-ngrx.component.html',
- styleUrls: ['./commits-with-ngrx.component.scss'],
- changeDetection: ChangeDetectionStrategy.OnPush
- })
- export class CommitsWithNgrxComponent {
- commits$: Observable<Commit[]>;
- commitsFailures$: Observable<Failure[]>;
- constructor(private store: Store<AppState>) {
- this.commits$ = this.store.select(commits);
- this.commitsFailures$ = this.store.select(commitsFailuerState);
- }
- search(username) {
- this.store.dispatch(new LoadCommits({ username }));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement