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
import React, {PureComponent} from 'react'; | |
import {List} from 'react-virtualized'; | |
import debounce from 'lodash/debounce'; | |
class ScrollSpeed { | |
clear = () => { | |
this.lastPosition = null; | |
this.delta = 0; | |
}; | |
getScrollSpeed(scrollOffset) { |
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
/** | |
* Smoothly animate between two values | |
* @param {Number} fromValue - the initial value | |
* @param {Function} onUpdate - A function that is called on each tick | |
* @param {Function} onComplete - A callback that is fired once the scroll animation ends | |
* @param {Number} duration - the desired duration of the scroll animation | |
*/ | |
export default function animate({ | |
fromValue, | |
toValue, |