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

Revert "OZG-6477 7306 listResource bug, missing debounce"

This reverts commit 2e3871da.
parent 2e3871da
No related branches found
No related tags found
No related merge requests found
...@@ -85,23 +85,23 @@ describe('ListResourceService', () => { ...@@ -85,23 +85,23 @@ describe('ListResourceService', () => {
isInvalidResourceCombinationSpy = jest.spyOn(ResourceUtil, 'isInvalidResourceCombination').mockReturnValue(true); isInvalidResourceCombinationSpy = jest.spyOn(ResourceUtil, 'isInvalidResourceCombination').mockReturnValue(true);
}); });
it('should handle config resource changed after debounce time', fakeAsync(() => { it('should handle config resource changed', fakeAsync(() => {
service.getList().subscribe(); service.getList().subscribe();
tick(300); tick();
expect(service.handleChanges).toHaveBeenCalledWith(listStateResource, baseResource); expect(service.handleChanges).toHaveBeenCalledWith(listStateResource, baseResource);
})); }));
it('should handle null configresource after debounce time', fakeAsync(() => { it('should handle null configresource', fakeAsync(() => {
service.getList().subscribe(); service.getList().subscribe();
tick(300); tick();
expect(service.handleNullConfigResource).toHaveBeenCalledWith(baseResource); expect(service.handleNullConfigResource).toHaveBeenCalledWith(baseResource);
})); }));
it('should call isInvalidResourceCombinationSpy after debounce time', fakeAsync(() => { it('should call isInvalidResourceCombinationSpy', fakeAsync(() => {
service.getList().subscribe(); service.getList().subscribe();
tick(300); tick();
expect(isInvalidResourceCombinationSpy).toHaveBeenCalled(); expect(isInvalidResourceCombinationSpy).toHaveBeenCalled();
})); }));
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
import { Resource, ResourceUri, getUrl, hasLink } from '@ngxp/rest'; import { Resource, ResourceUri, getUrl, hasLink } from '@ngxp/rest';
import { isEqual, isNil, isNull } from 'lodash-es'; import { isEqual, isNil, isNull } from 'lodash-es';
import { BehaviorSubject, Observable, combineLatest, debounce, filter, first, interval, map, startWith, tap } from 'rxjs'; import { BehaviorSubject, Observable, combineLatest, filter, first, map, startWith, tap } from 'rxjs';
import { isNotNull, isNotUndefined } from '../tech.util'; import { isNotNull, isNotUndefined } from '../tech.util';
import { CreateResourceData, ListItemResource, ListResourceServiceConfig } from './resource.model'; import { CreateResourceData, ListItemResource, ListResourceServiceConfig } from './resource.model';
import { ResourceRepository } from './resource.repository'; import { ResourceRepository } from './resource.repository';
...@@ -64,7 +64,6 @@ export class ResourceListService<B extends Resource, T extends ListResource, I e ...@@ -64,7 +64,6 @@ export class ResourceListService<B extends Resource, T extends ListResource, I e
public getList(): Observable<StateResource<T>> { public getList(): Observable<StateResource<T>> {
return combineLatest([this.listResource.asObservable(), this.getConfigResource()]).pipe( return combineLatest([this.listResource.asObservable(), this.getConfigResource()]).pipe(
debounce(() => interval(300)),
tap(([stateResource, configResource]) => { tap(([stateResource, configResource]) => {
this.handleChanges(stateResource, configResource); this.handleChanges(stateResource, configResource);
}), }),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment