Skip to content

Commit

Permalink
fix(lib): refcount streams in ElementBoundaryService
Browse files Browse the repository at this point in the history
  • Loading branch information
gund committed Jul 29, 2020
1 parent 7ad57ba commit 3f4264a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class ElementBoundaryService {
map((boundaries) =>
boundaries.sort((b1, b2) => this.sortBoundariesByDepth(b1, b2)),
),
shareReplay({ bufferSize: 1, refCount: false }),
shareReplay({ bufferSize: 1, refCount: true }),
);

constructor(
Expand All @@ -50,13 +50,14 @@ export class ElementBoundaryService {
map((boundaries) =>
boundaries.find(
(boundary) =>
boundary.element !== element &&
boundary.element.contains(element) &&
!this.hasComponentsBetween(boundary.element, element),
),
),
filter(isDefined),
(o$) => (timeoutMs > 0 ? o$.pipe(timeoutWith(timeoutMs, of(null))) : o$),
shareReplay({ bufferSize: 1, refCount: false }),
shareReplay({ bufferSize: 1, refCount: true }),
);
}

Expand Down

0 comments on commit 3f4264a

Please sign in to comment.