24 lines
602 B
TypeScript
Raw Normal View History

2019-09-19 14:15:43 +09:00
import { Component, OnInit } from '@angular/core';
2019-09-27 12:53:21 +09:00
import { Store, select } from '@ngrx/store';
import * as AppSotre from '@app/store';
import { Observable } from 'rxjs';
2019-09-18 15:02:21 +09:00
@Component({
selector: 'app-page-messenger-main',
templateUrl: './main.page.component.html',
styleUrls: ['./main.page.component.scss']
})
2019-09-19 14:15:43 +09:00
export class MainPageComponent implements OnInit {
2019-10-08 11:19:47 +09:00
selectedChat$: Observable<string | null>;
2019-09-27 12:53:21 +09:00
constructor(private store: Store<any>) {}
2019-09-19 14:15:43 +09:00
ngOnInit(): void {
2019-09-27 12:53:21 +09:00
this.selectedChat$ = this.store.pipe(
select(AppSotre.MessengerSelector.ChatSelector.selectedRoom)
);
2019-09-19 14:15:43 +09:00
}
2019-09-18 15:02:21 +09:00
}