Skip to content

Commit 036a40a

Browse files
crisbetojelbourn
authored andcommitted
refactor: clean up ReplaySubject usages (#17804)
Replaces some usages of `ReplaySubject` with a plain `Subject` since we don't use `ReplaySubject` anywhere else in the codebase and in these cases it doesn't provide any benefit. This should lead to less code being imported as a result of Material.
1 parent 03d39cd commit 036a40a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/cdk-experimental/popover-edit/lens-directives.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {ReplaySubject} from 'rxjs';
9+
import {Subject} from 'rxjs';
1010
import {
1111
Directive,
1212
ElementRef,
@@ -41,7 +41,7 @@ export type PopoverEditClickOutBehavior = 'close' | 'submit' | 'noop';
4141
providers: [EditRef],
4242
})
4343
export class CdkEditControl<FormValue> implements OnDestroy, OnInit {
44-
protected readonly destroyed = new ReplaySubject<void>();
44+
protected readonly destroyed = new Subject<void>();
4545

4646
/**
4747
* Specifies what should happen when the user clicks outside of the edit lens.

src/cdk-experimental/popover-edit/table-directives.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
ViewContainerRef,
2020
HostListener,
2121
} from '@angular/core';
22-
import {fromEvent, fromEventPattern, merge, ReplaySubject} from 'rxjs';
22+
import {fromEvent, fromEventPattern, merge, Subject} from 'rxjs';
2323
import {
2424
filter,
2525
map,
@@ -65,7 +65,7 @@ const MOUSE_MOVE_THROTTLE_TIME_MS = 10;
6565
providers: [EditEventDispatcher, EditServices],
6666
})
6767
export class CdkEditable implements AfterViewInit, OnDestroy {
68-
protected readonly destroyed = new ReplaySubject<void>();
68+
protected readonly destroyed = new Subject<void>();
6969

7070
constructor(
7171
protected readonly elementRef: ElementRef,
@@ -202,7 +202,7 @@ export class CdkPopoverEdit<C> implements AfterViewInit, OnDestroy {
202202

203203
protected focusTrap?: FocusTrap;
204204
protected overlayRef?: OverlayRef;
205-
protected readonly destroyed = new ReplaySubject<void>();
205+
protected readonly destroyed = new Subject<void>();
206206

207207
constructor(
208208
protected readonly services: EditServices, protected readonly elementRef: ElementRef,
@@ -374,7 +374,7 @@ export class CdkPopoverEditTabOut<C> extends CdkPopoverEdit<C> {
374374
selector: '[cdkRowHoverContent]',
375375
})
376376
export class CdkRowHoverContent implements AfterViewInit, OnDestroy {
377-
protected readonly destroyed = new ReplaySubject<void>();
377+
protected readonly destroyed = new Subject<void>();
378378
protected viewRef: EmbeddedViewRef<any>|null = null;
379379

380380
private _row?: Element;

0 commit comments

Comments
 (0)