Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed Aug 8, 2023
1 parent df6c596 commit 609141d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ export type VirtualStore = {
_getItemLength(): number;
_getScrollOffset(): number;
_getScrollOffsetMax(): number;
_getIsScrolling(): boolean;
_getViewportSize(): number;
_getCorrectedScrollSize(): number;
_getJumpCount(): number;
_flushJump(): ScrollJump;
_getItemIndexForScrollTo(offset: number): number;
_subscribe(target: number, cb: Subscriber): () => void;
_update(...action: Actions): void;
_getIsScrolling(): boolean;
_updateCacheLength(length: number): void;
};

Expand Down Expand Up @@ -163,6 +163,9 @@ export const createVirtualStore = (
return scrollOffset;
},
_getScrollOffsetMax: getScrollOffsetMax,
_getIsScrolling() {
return _scrollDirection !== SCROLL_IDLE;
},
_getViewportSize() {
return viewportSize;
},
Expand Down Expand Up @@ -324,9 +327,6 @@ export const createVirtualStore = (
});
}
},
_getIsScrolling() {
return _scrollDirection !== SCROLL_IDLE;
},
_updateCacheLength(length) {
// It's ok to be updated in render because states should be calculated consistently regardless cache length
if (cache._length === length) return;
Expand Down

0 comments on commit 609141d

Please sign in to comment.