diff --git a/src/assets/javascripts/browser/location/base/index.ts b/src/assets/javascripts/browser/location/base/index.ts index 67ac66e63..ccd9176a0 100644 --- a/src/assets/javascripts/browser/location/base/index.ts +++ b/src/assets/javascripts/browser/location/base/index.ts @@ -51,6 +51,6 @@ export function watchLocationBase( .toString() .replace(/\/$/, "") ), - shareReplay(1) + shareReplay({ bufferSize: 1, refCount: true }) ) } diff --git a/src/assets/javascripts/browser/media/index.ts b/src/assets/javascripts/browser/media/index.ts index 045b54395..b7712c793 100644 --- a/src/assets/javascripts/browser/media/index.ts +++ b/src/assets/javascripts/browser/media/index.ts @@ -41,6 +41,6 @@ export function watchMedia(query: string): Observable { ) .pipe( startWith(media.matches), - shareReplay(1) + shareReplay({ bufferSize: 1, refCount: true }) ) } diff --git a/src/assets/javascripts/browser/viewport/_/index.ts b/src/assets/javascripts/browser/viewport/_/index.ts index c918bc5ef..6e8d7ed6a 100644 --- a/src/assets/javascripts/browser/viewport/_/index.ts +++ b/src/assets/javascripts/browser/viewport/_/index.ts @@ -78,7 +78,7 @@ export function watchViewport(): Observable { ]) .pipe( map(([offset, size]) => ({ offset, size })), - shareReplay(1) + shareReplay({ bufferSize: 1, refCount: true }) ) } @@ -116,7 +116,6 @@ export function watchViewportAt( y: offset.y - y + height }, size - })), - shareReplay(1) + })) ) }