feature/Refactor report tabs into smart components
Squashed commit of the following:
commit c06e423c1df39d653150d58439d0fabb268f1ff7
Merge: 4395b97f cc22c5cd
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date: Fri Oct 29 08:28:47 2021 +0200
Merged develop and fixed conflicts
commit 4395b97fdc50f6f5c4bb2e20444031cde230ca5b
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date: Fri Oct 29 08:15:53 2021 +0200
Updated loading inside deltagare-tabs
commit 84e9bf4730d1f996e9acf8c624de775e12889c18
Author: Daniel Appelgren <daniel.appelgren@arbetsformedlingen.se>
Date: Thu Oct 28 21:45:50 2021 +0200
cleanup
commit c3044cc7f6701e4cf35f9efdb39c310a6a49aa97
Author: Daniel Appelgren <daniel.appelgren@arbetsformedlingen.se>
Date: Thu Oct 28 21:41:27 2021 +0200
cleanup
commit f56b2827bf3df9d372e5141442153de70e13a6e4
Author: Daniel Appelgren <daniel.appelgren@arbetsformedlingen.se>
Date: Thu Oct 28 16:56:39 2021 +0200
reformat
commit f41dda3445dc6489374f882ef7845078f365836a
Author: Daniel Appelgren <daniel.appelgren@arbetsformedlingen.se>
Date: Thu Oct 28 16:53:13 2021 +0200
make report tabs into smart components
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { PaginationParams } from '@msfa-models/api/params.model';
|
||||
import { BehaviorSubject, combineLatest } from 'rxjs';
|
||||
import { switchMap, tap } from 'rxjs/operators';
|
||||
import { switchMap } from 'rxjs/operators';
|
||||
import { DeltagareHandelserApiService } from './api/deltagare-handelser-api.service';
|
||||
|
||||
const DEFAULT_PARAMS: PaginationParams = {
|
||||
@@ -15,15 +15,10 @@ const DEFAULT_PARAMS: PaginationParams = {
|
||||
export class DeltagareHandelserService {
|
||||
private _params$ = new BehaviorSubject<PaginationParams>(DEFAULT_PARAMS);
|
||||
private _genomforandeReferens$ = new BehaviorSubject<number>(null);
|
||||
private _handelserLoading$ = new BehaviorSubject<boolean>(false);
|
||||
handelserLoading$ = this._handelserLoading$.asObservable();
|
||||
|
||||
deltagareHandelserData$ = combineLatest([this._genomforandeReferens$, this._params$]).pipe(
|
||||
switchMap(([genomforandeReferens, params]) => {
|
||||
this._handelserLoading$.next(true);
|
||||
return this.deltagareHandelserApiService
|
||||
.fetchDeltagareHandelser$(genomforandeReferens, params)
|
||||
.pipe(tap(() => this._handelserLoading$.next(false)));
|
||||
return this.deltagareHandelserApiService.fetchDeltagareHandelser$(genomforandeReferens, params);
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user