Skip to content
Snippets Groups Projects
Verified Commit 4826d1d0 authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-6185 remove debounce from resource service

parent aeaf25c9
Branches
Tags
1 merge request!68OZG-6185 fix versenden step
...@@ -24,35 +24,14 @@ ...@@ -24,35 +24,14 @@
import { HttpErrorResponse } from '@angular/common/http'; import { HttpErrorResponse } from '@angular/common/http';
import { getUrl, hasLink, Resource, ResourceUri } from '@ngxp/rest'; import { getUrl, hasLink, Resource, ResourceUri } from '@ngxp/rest';
import { isEqual, isNull } from 'lodash-es'; import { isEqual, isNull } from 'lodash-es';
import { import { BehaviorSubject, catchError, combineLatest, filter, first, map, Observable, of, startWith, tap, throwError } from 'rxjs';
BehaviorSubject,
catchError,
combineLatest,
debounceTime,
filter,
first,
map,
Observable,
of,
startWith,
tap,
throwError,
} from 'rxjs';
import { isUnprocessableEntity } from '../http.util'; import { isUnprocessableEntity } from '../http.util';
import { HttpError } from '../tech.model'; import { HttpError } from '../tech.model';
import { isNotNull } from '../tech.util'; import { isNotNull } from '../tech.util';
import { ResourceServiceConfig } from './resource.model'; import { ResourceServiceConfig } from './resource.model';
import { ResourceRepository } from './resource.repository'; import { ResourceRepository } from './resource.repository';
import { mapToFirst, mapToResource } from './resource.rxjs.operator'; import { mapToFirst, mapToResource } from './resource.rxjs.operator';
import { import { createEmptyStateResource, createErrorStateResource, createStateResource, isInvalidResourceCombination, isLoadingRequired, isStateResoureStable, StateResource, } from './resource.util';
createEmptyStateResource,
createErrorStateResource,
createStateResource,
isInvalidResourceCombination,
isLoadingRequired,
isStateResoureStable,
StateResource,
} from './resource.util';
/** /**
* B = Type of baseresource * B = Type of baseresource
...@@ -70,7 +49,6 @@ export abstract class ResourceService<B extends Resource, T extends Resource> { ...@@ -70,7 +49,6 @@ export abstract class ResourceService<B extends Resource, T extends Resource> {
public get(): Observable<StateResource<T>> { public get(): Observable<StateResource<T>> {
return combineLatest([this.stateResource.asObservable(), this.getConfigResource()]).pipe( return combineLatest([this.stateResource.asObservable(), this.getConfigResource()]).pipe(
debounceTime(50),
tap(([stateResource, configResource]) => this.handleResourceChanges(stateResource, configResource)), tap(([stateResource, configResource]) => this.handleResourceChanges(stateResource, configResource)),
filter(([stateResource]) => !isInvalidResourceCombination(stateResource, this.configResource)), filter(([stateResource]) => !isInvalidResourceCombination(stateResource, this.configResource)),
mapToFirst<T, B>(), mapToFirst<T, B>(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment