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