mempool/frontend/src/app/services/assets.service.ts

23 lines
695 B
TypeScript
Raw Normal View History

2020-05-02 07:36:35 +02:00
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ReplaySubject, Observable } from 'rxjs';
2020-05-02 07:36:35 +02:00
import { environment } from 'src/environments/environment';
import { shareReplay } from 'rxjs/operators';
2020-05-02 07:36:35 +02:00
@Injectable({
providedIn: 'root'
})
export class AssetsService {
network = environment.network;
getAssetsJson$: Observable<any>;
getAssetsMinimalJson$: Observable<any>;
2020-05-02 07:36:35 +02:00
constructor(
private httpClient: HttpClient,
) {
this.getAssetsJson$ = this.httpClient.get('/resources/assets.json').pipe(shareReplay());
this.getAssetsMinimalJson$ = this.httpClient.get('/resources/assets.minimal.json').pipe(shareReplay());
}
2020-05-02 07:36:35 +02:00
}