diff --git a/src/app/@core/utils/layout.service.ts b/src/app/@core/utils/layout.service.ts index 6854fd32..2a8fb82d 100644 --- a/src/app/@core/utils/layout.service.ts +++ b/src/app/@core/utils/layout.service.ts @@ -1,20 +1,20 @@ import { Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs'; -import { delay, share } from 'rxjs/operators'; +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.layoutSize$.pipe( - share(), - delay(1), - ); + return this.layoutSizeChange$.pipe(delay(1)); } }