Adding OnPush to more components

This commit is contained in:
softsimon
2020-08-09 10:39:27 +07:00
parent 648be481d7
commit 63fb733dc2
2 changed files with 7 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
import { Component, Input, OnChanges } from '@angular/core';
import { Component, Input, OnChanges, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { AssetsService } from 'src/app/services/assets.service';
import { Transaction } from 'src/app/interfaces/electrs.interface';
@@ -6,6 +6,7 @@ import { Transaction } from 'src/app/interfaces/electrs.interface';
selector: 'app-miner',
templateUrl: './miner.component.html',
styleUrls: ['./miner.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MinerComponent implements OnChanges {
@Input() coinbaseTransaction: Transaction;
@@ -16,6 +17,7 @@ export class MinerComponent implements OnChanges {
constructor(
private assetsService: AssetsService,
private cd: ChangeDetectorRef,
) { }
ngOnChanges() {
@@ -56,6 +58,7 @@ export class MinerComponent implements OnChanges {
}
this.loading = false;
this.cd.markForCheck();
});
}