Skip to content
Snippets Groups Projects
Commit 4cca89e4 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-2626 OZG-2886 flatMap deprecated, use mergeMap

parent 1868f955
Branches
Tags
No related merge requests found
...@@ -8,7 +8,7 @@ import { getUrl } from '@ngxp/rest'; ...@@ -8,7 +8,7 @@ import { getUrl } from '@ngxp/rest';
import { Resource, ResourceUri } from '@ngxp/rest/lib/resource.model'; import { Resource, ResourceUri } from '@ngxp/rest/lib/resource.model';
import { isNil } from 'lodash-es'; import { isNil } from 'lodash-es';
import { BehaviorSubject, Observable, of, Subscription, throwError } from 'rxjs'; import { BehaviorSubject, Observable, of, Subscription, throwError } from 'rxjs';
import { catchError, filter, first, flatMap, mergeMap } from 'rxjs/operators'; import { catchError, filter, first, mergeMap } from 'rxjs/operators';
import { UserProfileListResource, UserProfileResource } from './user-profile.model'; import { UserProfileListResource, UserProfileResource } from './user-profile.model';
import { UserProfileRepository } from './user-profile.repository'; import { UserProfileRepository } from './user-profile.repository';
...@@ -80,7 +80,7 @@ export class UserProfileService { ...@@ -80,7 +80,7 @@ export class UserProfileService {
private loadCurrentUser(): Observable<UserProfileResource> { private loadCurrentUser(): Observable<UserProfileResource> {
return this.apiRootFacade.getApiRoot().pipe( return this.apiRootFacade.getApiRoot().pipe(
filter(stateResource => stateResource.loaded), filter(stateResource => stateResource.loaded),
flatMap(stateResource => this.repository.getCurrentUser(stateResource.resource)), mergeMap(stateResource => this.repository.getCurrentUser(stateResource.resource)),
first() first()
) )
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment