Skip to content

Commit

Permalink
fix(core): correctly emit MediaChange events
Browse files Browse the repository at this point in the history
MediaObserver was showing an inconsistent behavior of the public `asObservable` method, emitting incorrect MediaChange events. For example, it was possible to receive both `sm` and `md` events at the same time as you resize your screen.

Related to angular#1059
  • Loading branch information
Paulo Tokimatu committed Aug 19, 2019
1 parent d02377a commit 75c9e5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/core/media-observer/media-observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class MediaObserver implements OnDestroy {
.observe(this.hook.withPrintQuery(mqList))
.pipe(
filter((change: MediaChange) => change.matches),
debounceTime(0, asapScheduler),
debounceTime(10, asapScheduler),
switchMap(_ => of(this.findAllActivations())),
map(excludeOverlaps),
filter(hasChanges),
Expand Down

0 comments on commit 75c9e5d

Please sign in to comment.