From db400f447a9f7aae1c56fa25396e93069744483f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 15 May 2018 11:55:51 +0200 Subject: Upgrade to rxjs 6 --- client/src/app/shared/account/account.service.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'client/src/app/shared/account') diff --git a/client/src/app/shared/account/account.service.ts b/client/src/app/shared/account/account.service.ts index 8c66ae04a..20e52d946 100644 --- a/client/src/app/shared/account/account.service.ts +++ b/client/src/app/shared/account/account.service.ts @@ -1,14 +1,11 @@ +import { map, tap, catchError } from 'rxjs/operators' import { Injectable } from '@angular/core' -import 'rxjs/add/operator/catch' -import 'rxjs/add/operator/map' import { environment } from '../../../environments/environment' -import { Observable } from 'rxjs/Observable' +import { Observable, ReplaySubject } from 'rxjs' import { Account } from '@app/shared/account/account.model' import { RestExtractor } from '@app/shared/rest/rest-extractor.service' -import { RestService } from '@app/shared/rest/rest.service' import { HttpClient } from '@angular/common/http' import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model' -import { ReplaySubject } from 'rxjs/ReplaySubject' @Injectable() export class AccountService { @@ -18,14 +15,15 @@ export class AccountService { constructor ( private authHttp: HttpClient, - private restExtractor: RestExtractor, - private restService: RestService + private restExtractor: RestExtractor ) {} getAccount (id: number): Observable { return this.authHttp.get(AccountService.BASE_ACCOUNT_URL + id) - .map(accountHash => new Account(accountHash)) - .do(account => this.accountLoaded.next(account)) - .catch((res) => this.restExtractor.handleError(res)) + .pipe( + map(accountHash => new Account(accountHash)), + tap(account => this.accountLoaded.next(account)), + catchError(res => this.restExtractor.handleError(res)) + ) } } -- cgit v1.2.3