Used to keep track of our scroll position, scroll deltas and trigger an onScroll callback.
Could either listen to the native scroll event or be hooked to any scroll (natural or virtual) scroll event

Constructors

Properties

scroll: DOMPosition

Current scroll position

Last scroll deltas

shouldWatch: boolean

Whether the ScrollManager should listen to the window scroll event or not

onScroll: ((delta?) => void)

Callback to execute each time the scroll values change

Type declaration

    • (delta?): void
    • Callback to execute each time the scroll values change

      Parameters

      Returns void

Methods

  • Updates the scroll manager X and Y scroll values as well as last X and Y deltas Internally called by the scroll event listener Could be called externally as well if the user wants to handle the scroll by himself

    Parameters

    Returns void

  • Destroy our scroll manager (just remove our event listner if it had been added previously)

    Returns void