mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-14 19:07:41 +01:00
Refactored other browser observables, removed memleaks
This commit is contained in:
parent
8a6b89ffe1
commit
c7d770bbe3
@ -51,6 +51,6 @@ export function watchLocationBase(
|
|||||||
.toString()
|
.toString()
|
||||||
.replace(/\/$/, "")
|
.replace(/\/$/, "")
|
||||||
),
|
),
|
||||||
shareReplay(1)
|
shareReplay({ bufferSize: 1, refCount: true })
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,6 @@ export function watchMedia(query: string): Observable<boolean> {
|
|||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
startWith(media.matches),
|
startWith(media.matches),
|
||||||
shareReplay(1)
|
shareReplay({ bufferSize: 1, refCount: true })
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ export function watchViewport(): Observable<Viewport> {
|
|||||||
])
|
])
|
||||||
.pipe(
|
.pipe(
|
||||||
map(([offset, size]) => ({ offset, size })),
|
map(([offset, size]) => ({ offset, size })),
|
||||||
shareReplay(1)
|
shareReplay({ bufferSize: 1, refCount: true })
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +116,6 @@ export function watchViewportAt(
|
|||||||
y: offset.y - y + height
|
y: offset.y - y + height
|
||||||
},
|
},
|
||||||
size
|
size
|
||||||
})),
|
}))
|
||||||
shareReplay(1)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user