Skip to content

Instantly share code, notes, and snippets.

@sueLan
Created March 5, 2020 13:33
Show Gist options
  • Save sueLan/d3d936da495fb8535685c267ab73f096 to your computer and use it in GitHub Desktop.
Save sueLan/d3d936da495fb8535685c267ab73f096 to your computer and use it in GitHub Desktop.
const timestamp = e.timeStamp;
let visibleLength = this._selectLength(e.nativeEvent.layoutMeasurement);
let contentLength = this._selectLength(e.nativeEvent.contentSize);
let offset = this._selectOffset(e.nativeEvent.contentOffset);
let dOffset = offset - this._scrollMetrics.offset;
// ...
this._scrollMetrics = {
contentLength,
dt,
dOffset,
offset,
timestamp,
velocity,
visibleLength,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment