mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-16 07:30:12 +01:00
feat: add safe delayed event of layout change
This commit is contained in:
parent
2d75441977
commit
448229bd7f
1 changed files with 7 additions and 1 deletions
|
|
@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue