biome format --write
This commit is contained in:
parent
8372348148
commit
9262e803ec
415 changed files with 54076 additions and 17419 deletions
|
|
@ -3,14 +3,17 @@ export const getScrollPosition = () => {
|
|||
return {
|
||||
scrollTop: window.scrollY,
|
||||
scrollHeight: document.documentElement.scrollHeight,
|
||||
offsetHeight: window.innerHeight
|
||||
offsetHeight: window.innerHeight,
|
||||
}
|
||||
}
|
||||
|
||||
// A helper function that is used to keep the scroll position fixed as the new elements are added to the top
|
||||
// Takes two scroll positions, before and after the update.
|
||||
export const getNewTopPosition = (previousPosition, newPosition) => {
|
||||
return previousPosition.scrollTop + (newPosition.scrollHeight - previousPosition.scrollHeight)
|
||||
return (
|
||||
previousPosition.scrollTop +
|
||||
(newPosition.scrollHeight - previousPosition.scrollHeight)
|
||||
)
|
||||
}
|
||||
|
||||
export const isBottomedOut = (offset = 0) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue