Data model simplification

This commit is contained in:
2020-07-30 19:31:50 -04:00
parent e810c4a240
commit 6514eb7c76
16 changed files with 75 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Observable, BehaviorSubject } from 'rxjs';
import { HubConnectionBuilder, HubConnection } from '@aspnet/signalr';
import { WeatherReading } from 'src/app/models/weather/weather-reading';
import { WeatherUpdate } from 'src/app/models/weather/weather-update';
import { WeatherValue } from 'src/app/models/weather/weather-value';
import { HttpClient } from '@angular/common/http';
@@ -13,7 +13,7 @@ import { WeatherValueType } from 'src/app/models/weather/weather-value-type';
})
export class WeatherService {
private connection: HubConnection;
private latestReading: BehaviorSubject<WeatherReading> = new BehaviorSubject<WeatherReading>(null);
private latestReading: BehaviorSubject<WeatherUpdate> = new BehaviorSubject<WeatherUpdate>(null);
constructor(private httpClient: HttpClient) {
this.connection = new HubConnectionBuilder()
@@ -27,7 +27,7 @@ export class WeatherService {
this.connection.start();
}
getLatestReading(): Observable<WeatherReading> {
getLatestReading(): Observable<WeatherUpdate> {
return this.latestReading.asObservable();
}