Skip to content

Commit 3f4264a

Browse files
committed
fix(lib): refcount streams in ElementBoundaryService
1 parent 7ad57ba commit 3f4264a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

projects/ngx-element-boundary/src/lib/element-boundary.service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class ElementBoundaryService {
2424
map((boundaries) =>
2525
boundaries.sort((b1, b2) => this.sortBoundariesByDepth(b1, b2)),
2626
),
27-
shareReplay({ bufferSize: 1, refCount: false }),
27+
shareReplay({ bufferSize: 1, refCount: true }),
2828
);
2929

3030
constructor(
@@ -50,13 +50,14 @@ export class ElementBoundaryService {
5050
map((boundaries) =>
5151
boundaries.find(
5252
(boundary) =>
53+
boundary.element !== element &&
5354
boundary.element.contains(element) &&
5455
!this.hasComponentsBetween(boundary.element, element),
5556
),
5657
),
5758
filter(isDefined),
5859
(o$) => (timeoutMs > 0 ? o$.pipe(timeoutWith(timeoutMs, of(null))) : o$),
59-
shareReplay({ bufferSize: 1, refCount: false }),
60+
shareReplay({ bufferSize: 1, refCount: true }),
6061
);
6162
}
6263

0 commit comments

Comments
 (0)