UNPKG

vscroll

Version:
31 lines 808 B
export class ScrollModel { constructor() { this.reset(); } reset() { this.previous = null; this.current = null; this.syntheticPosition = null; this.syntheticFulfill = false; this.positionBeforeAsync = null; this.positionBeforeAdjust = null; this.positionAfterAdjust = null; this.stop(); } stop() { if (this.scrollTimer) { clearTimeout(this.scrollTimer); this.scrollTimer = null; } if (this.cancelAnimation) { this.cancelAnimation(); this.cancelAnimation = null; } } hasPositionChanged(position) { const before = this.positionBeforeAdjust; const after = this.positionAfterAdjust; return before === null || before !== position || after === null || after !== position; } } //# sourceMappingURL=scroll.js.map