Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Component({
- selector: 'another-component',
- templateUrl: 'another.template.html',
- })
- export class AnotherComponent implements OnInit {
- data;
- constructor(
- private eventQueue: EventQueueService,
- private dataService: DataService,
- ) {}
- ngOnInit() {
- this.eventQueue.on(AppEventType.AccountChanged)
- .pipe(
- switchMap(() => this.dataService.getData()),
- )
- .subscribe(res => this.handleEvent(res));
- }
- handleEvent(res) {
- // Do something with the response
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement