diff --git a/src/@fuse/services/match-media.service.ts b/src/@fuse/services/match-media.service.ts index e096900a..9e6df82d 100644 --- a/src/@fuse/services/match-media.service.ts +++ b/src/@fuse/services/match-media.service.ts @@ -1,6 +1,7 @@ import { MediaChange, ObservableMedia } from '@angular/flex-layout'; import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; +import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; @Injectable({ providedIn: 'root' @@ -38,7 +39,11 @@ export class FuseMatchMediaService */ private _init(): void { - this._observableMedia + this._observableMedia.asObservable() + .pipe( + debounceTime(500), + distinctUntilChanged() + ) .subscribe((change: MediaChange) => { if ( this.activeMediaQuery !== change.mqAlias ) {