This commit is contained in:
falmeidapavao 2024-11-29 00:50:46 +00:00 committed by GitHub
commit 93fbe4ec58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 17 deletions

View file

@ -17,10 +17,10 @@ export class ContactsComponent implements OnDestroy {
recent: any[];
constructor(private userService: UserData) {
forkJoin(
forkJoin([
this.userService.getContacts(),
this.userService.getRecentUsers(),
)
])
.pipe(takeWhile(() => this.alive))
.subscribe(([contacts, recent]: [Contacts[], RecentUsers[]]) => {
this.contacts = contacts;

View file

@ -1,6 +1,5 @@
import { Component, OnDestroy } from '@angular/core';
import { NbThemeService } from '@nebular/theme';
import { Electricity, ElectricityChart, ElectricityData } from '../../../@core/data/electricity';
import { takeWhile } from 'rxjs/operators';
import { forkJoin } from 'rxjs';
@ -31,12 +30,12 @@ export class ElectricityComponent implements OnDestroy {
this.currentTheme = theme.name;
});
forkJoin(
forkJoin([
this.electricityService.getListData(),
this.electricityService.getChartData(),
)
])
.pipe(takeWhile(() => this.alive))
.subscribe(([listData, chartData]: [Electricity[], ElectricityChart[]] ) => {
.subscribe(([listData, chartData]: [Electricity[], ElectricityChart[]]) => {
this.listData = listData;
this.chartData = chartData;
});

View file

@ -34,10 +34,10 @@ export class TemperatureComponent implements OnDestroy {
this.theme = config.variables.temperature;
});
forkJoin(
forkJoin([
this.temperatureHumidityService.getTemperatureData(),
this.temperatureHumidityService.getHumidityData(),
)
])
.subscribe(([temperatureData, humidityData]: [Temperature, Temperature]) => {
this.temperatureData = temperatureData;
this.temperature = this.temperatureData.value;

View file

@ -14,7 +14,7 @@ export class ECommerceVisitorsAnalyticsComponent implements OnDestroy {
private alive = true;
pieChartValue: number;
chartLegend: {iconColor: string; title: string}[];
chartLegend: { iconColor: string; title: string }[];
visitorsAnalyticsData: { innerLine: number[]; outerLine: OutlineData[]; };
constructor(private themeService: NbThemeService,
@ -25,11 +25,11 @@ export class ECommerceVisitorsAnalyticsComponent implements OnDestroy {
this.setLegendItems(theme.variables.visitorsLegend);
});
forkJoin(
forkJoin([
this.visitorsAnalyticsChartService.getInnerLineChartData(),
this.visitorsAnalyticsChartService.getOutlineLineChartData(),
this.visitorsAnalyticsChartService.getPieChartData(),
)
])
.pipe(takeWhile(() => this.alive))
.subscribe(([innerLine, outerLine, pieChartValue]: [number[], OutlineData[], number]) => {
this.visitorsAnalyticsData = {