Skip to content

Commit cf7bee2

Browse files
crisbetojelbourn
authored andcommitted
refactor: clean up unsafe takeUntil usages (#14185)
Cleans up some usages of `takeUntil` which are unsafe, because they're not at the end of the operator chain.
1 parent 7af8d02 commit cf7bee2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/cdk/layout/breakpoints-observer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ export class BreakpointObserver implements OnDestroy {
116116
},
117117
() => mql.removeListener(queryListener))
118118
.pipe(
119-
takeUntil(this._destroySubject),
120119
startWith(mql),
121-
map((nextMql: MediaQueryList) => ({query, matches: nextMql.matches}))
120+
map((nextMql: MediaQueryList) => ({query, matches: nextMql.matches})),
121+
takeUntil(this._destroySubject)
122122
);
123123

124124
// Add the MediaQueryList to the set of queries.

src/lib/sidenav/drawer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,8 @@ export class MatDrawerContainer implements AfterContentInit, DoCheck, OnDestroy
572572
*/
573573
private _watchDrawerToggle(drawer: MatDrawer): void {
574574
drawer._animationStarted.pipe(
575+
filter((event: AnimationEvent) => event.fromState !== event.toState),
575576
takeUntil(this._drawers.changes),
576-
filter((event: AnimationEvent) => event.fromState !== event.toState)
577577
)
578578
.subscribe((event: AnimationEvent) => {
579579
// Set the transition class on the container so that the animations occur. This should not

0 commit comments

Comments
 (0)