diff --git a/src/app/@core/utils/layout.service.ts b/src/app/@core/utils/layout.service.ts new file mode 100644 index 00000000..2a8fb82d --- /dev/null +++ b/src/app/@core/utils/layout.service.ts @@ -0,0 +1,20 @@ +import { Injectable } from '@angular/core'; +import { Observable, Subject } from 'rxjs'; +import { delay, shareReplay } from 'rxjs/operators'; + +@Injectable() +export class LayoutService { + + protected layoutSize$ = new Subject(); + protected layoutSizeChange$ = this.layoutSize$.pipe( + shareReplay({ refCount: true }), + ); + + changeLayoutSize() { + this.layoutSize$.next(); + } + + onChangeLayoutSize(): Observable { + return this.layoutSizeChange$.pipe(delay(1)); + } +}