feat: add safe delayed event of layout change

This commit is contained in:
sashaqred 2020-04-15 11:45:10 +03:00
parent f0d84a6485
commit 17485187b1
No known key found for this signature in database
GPG key ID: 0DB79F7B24682F4B

View file

@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { delay, shareReplay } from 'rxjs/operators';
import { delay, shareReplay, debounceTime } from 'rxjs/operators';
@Injectable()
export class LayoutService {
@ -17,4 +17,10 @@ export class LayoutService {
onChangeLayoutSize(): Observable<any> {
return this.layoutSizeChange$.pipe(delay(1));
}
onSafeChangeLayoutSize(): Observable<any> {
return this.layoutSizeChange$.pipe(
debounceTime(350),
);
}
}