@infinite-list/data-model
Advanced tools
Comparing version 0.2.32-perf.1 to 0.2.32-perf.2
@@ -90,2 +90,4 @@ import Batchinator from '@x-oasis/batchinator'; | ||
pump(_data: Array<ItemT>, baseIndex: number, keyToMetaMap: Map<string, ItemMeta>, intervalTree: PrefixIntervalTree): void; | ||
viewableItemsOnly(): void; | ||
resetViewableItems(): void; | ||
append(data: Array<ItemT>): void; | ||
@@ -109,2 +111,3 @@ shuffle(data: Array<ItemT>): void; | ||
isReserved: boolean; | ||
itemMeta?: ItemMeta; | ||
position: SpaceStateTokenPosition; | ||
@@ -111,0 +114,0 @@ }; |
@@ -7,2 +7,3 @@ import BaseDimensions from '../BaseDimensions'; | ||
import { OnEndReachedHelperProps } from './onEndReachedHelper'; | ||
import ItemMeta from '../ItemMeta'; | ||
import { OnViewableItemsChanged, ViewabilityConfig, ViewabilityConfigCallbackPairs } from './viewable'; | ||
@@ -178,2 +179,3 @@ export declare type GetItemSeparatorLength<ItemT> = (data: Array<ItemT>, index: number) => { | ||
isReserved: boolean; | ||
itemMeta: ItemMeta; | ||
position: SpaceStateTokenPosition; | ||
@@ -180,0 +182,0 @@ }; |
{ | ||
"name": "@infinite-list/data-model", | ||
"version": "0.2.32-perf.1", | ||
"version": "0.2.32-perf.2", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "dist", |
@@ -28,3 +28,3 @@ import Batchinator from '@x-oasis/batchinator'; | ||
eventName, | ||
batchUpdateEnabled = true, | ||
batchUpdateEnabled, | ||
defaultValue = false, | ||
@@ -31,0 +31,0 @@ once, |
@@ -804,2 +804,28 @@ import noop from '@x-oasis/noop'; | ||
viewableItemsOnly() { | ||
if (this._fillingMode === FillingMode.RECYCLE) { | ||
const { recycleState, spaceState } = this | ||
._stateResult as RecycleStateResult<ItemT>; | ||
const nextRecycleState = recycleState.filter((info) => { | ||
const { itemMeta } = info; | ||
if (itemMeta) { | ||
if (itemMeta?.getState().viewable) return true; | ||
return false; | ||
} | ||
return true; | ||
}); | ||
this._stateListener( | ||
{ | ||
recycleState: nextRecycleState, | ||
spaceState, | ||
}, | ||
this._stateResult | ||
); | ||
} | ||
} | ||
resetViewableItems() { | ||
if (this._scrollMetrics) this.dispatchMetrics(this._scrollMetrics); | ||
} | ||
append(data: Array<ItemT>) { | ||
@@ -806,0 +832,0 @@ const baseIndex = this._indexKeys.length; |
@@ -7,2 +7,3 @@ import BaseDimensions from '../BaseDimensions'; | ||
import { OnEndReachedHelperProps } from './onEndReachedHelper'; | ||
import ItemMeta from '../ItemMeta'; | ||
import { | ||
@@ -229,2 +230,3 @@ OnViewableItemsChanged, | ||
isReserved: boolean; | ||
itemMeta: ItemMeta; | ||
position: SpaceStateTokenPosition; | ||
@@ -231,0 +233,0 @@ }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1792126
21105