This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function _isViewable( | |
| viewAreaMode: boolean, | |
| viewablePercentThreshold: number, | |
| top: number, | |
| bottom: number, | |
| viewportHeight: number, | |
| itemLength: number, | |
| ): boolean { | |
| if (_isEntirelyVisible(top, bottom, viewportHeight)) { | |
| // Entirely visible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this._viewableIndices = viewableIndices; | |
| if (this._config.minimumViewTime) { | |
| const handle = setTimeout(() => { | |
| this._timers.delete(handle); | |
| this._onUpdateSync( | |
| viewableIndices, | |
| onViewableItemsChanged, | |
| createViewToken, | |
| ); | |
| }, this._config.minimumViewTime); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Filter out indices that have gone out of view since this call was scheduled. | |
| viewableIndicesToCheck = viewableIndicesToCheck.filter(ii => | |
| this._viewableIndices.includes(ii), | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _onUpdateSync( | |
| viewableIndicesToCheck, | |
| onViewableItemsChanged, | |
| createViewToken, | |
| ) { | |
| // Filter out indices that have gone out of view since this call was scheduled. | |
| viewableIndicesToCheck = viewableIndicesToCheck.filter(ii => | |
| this._viewableIndices.includes(ii), | |
| ); | |
| const prevItems = this._viewableItems; |
OlderNewer