2020-05-02 07:36:35 +02:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import { HttpClient } from '@angular/common/http';
|
2020-05-09 15:37:50 +02:00
|
|
|
import { Observable } from 'rxjs';
|
2020-05-05 10:26:23 +02:00
|
|
|
import { shareReplay } from 'rxjs/operators';
|
2020-05-02 07:36:35 +02:00
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
providedIn: 'root'
|
|
|
|
})
|
|
|
|
export class AssetsService {
|
2020-05-05 10:26:23 +02:00
|
|
|
getAssetsJson$: Observable<any>;
|
|
|
|
getAssetsMinimalJson$: Observable<any>;
|
2020-05-09 19:35:21 +02:00
|
|
|
getMiningPools$: Observable<any>;
|
2020-05-02 07:36:35 +02:00
|
|
|
|
|
|
|
constructor(
|
|
|
|
private httpClient: HttpClient,
|
|
|
|
) {
|
2020-05-05 10:26:23 +02:00
|
|
|
this.getAssetsJson$ = this.httpClient.get('/resources/assets.json').pipe(shareReplay());
|
|
|
|
this.getAssetsMinimalJson$ = this.httpClient.get('/resources/assets.minimal.json').pipe(shareReplay());
|
2020-05-09 19:35:21 +02:00
|
|
|
this.getMiningPools$ = this.httpClient.get('/resources/pools.json').pipe(shareReplay());
|
2020-05-02 11:29:34 +02:00
|
|
|
}
|
2020-05-02 07:36:35 +02:00
|
|
|
}
|