mempool/frontend/src/app/lightning/channels-list/channels-list.component.ts

24 lines
706 B
TypeScript
Raw Normal View History

2022-05-01 03:01:27 +04:00
import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { LightningApiService } from '../lightning-api.service';
@Component({
selector: 'app-channels-list',
templateUrl: './channels-list.component.html',
styleUrls: ['./channels-list.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ChannelsListComponent implements OnChanges {
@Input() publicKey: string;
channels$: Observable<any[]>;
constructor(
private lightningApiService: LightningApiService,
) { }
ngOnChanges(): void {
this.channels$ = this.lightningApiService.getChannelsByNodeId$(this.publicKey);
}
}