mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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.
This commit is contained in:
committed by
Jeremy Elbourn
parent
89a4c9cbe1
commit
5430e7cca5
@@ -116,9 +116,9 @@ export class BreakpointObserver implements OnDestroy {
|
||||
},
|
||||
() => mql.removeListener(queryListener))
|
||||
.pipe(
|
||||
takeUntil(this._destroySubject),
|
||||
startWith(mql),
|
||||
map((nextMql: MediaQueryList) => ({query, matches: nextMql.matches}))
|
||||
map((nextMql: MediaQueryList) => ({query, matches: nextMql.matches})),
|
||||
takeUntil(this._destroySubject)
|
||||
);
|
||||
|
||||
// Add the MediaQueryList to the set of queries.
|
||||
|
||||
@@ -572,8 +572,8 @@ export class MatDrawerContainer implements AfterContentInit, DoCheck, OnDestroy
|
||||
*/
|
||||
private _watchDrawerToggle(drawer: MatDrawer): void {
|
||||
drawer._animationStarted.pipe(
|
||||
filter((event: AnimationEvent) => event.fromState !== event.toState),
|
||||
takeUntil(this._drawers.changes),
|
||||
filter((event: AnimationEvent) => event.fromState !== event.toState)
|
||||
)
|
||||
.subscribe((event: AnimationEvent) => {
|
||||
// Set the transition class on the container so that the animations occur. This should not
|
||||
|
||||
Reference in New Issue
Block a user