How to use the dom-helpers/util/requestAnimationFrame.cancel function in dom-helpers

To help you get started, we’ve selected a few dom-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github taion / scroll-behavior / src / ScrollBehavior.js View on Github external
this._unlistenBefore = history.listenBefore(() => {
      if (this._saveWindowPositionHandle !== null) {
        requestAnimationFrame.cancel(this._saveWindowPositionHandle);
        this._saveWindowPositionHandle = null;
      }

      // It's fine to save element scroll positions here, though; the browser
      // won't modify them.
      Object.keys(this._scrollElements).forEach(key => {
        this._saveElementPosition(key);
      });
    });
  }
github taion / scroll-behavior / src / index.js View on Github external
Object.keys(this._scrollElements).forEach(key => {
        const scrollElement = this._scrollElements[key];
        requestAnimationFrame.cancel(scrollElement.savePositionHandle);
        scrollElement.savePositionHandle = null;

        // It's fine to save element scroll positions here, though; the browser
        // won't modify them.
        if (!this._ignoreScrollEvents) {
          this._saveElementPosition(key);
        }
      });
    });
github taion / scroll-behavior / src / index.js View on Github external
this._removeTransitionHook = addTransitionHook(() => {
      requestAnimationFrame.cancel(this._saveWindowPositionHandle);
      this._saveWindowPositionHandle = null;

      Object.keys(this._scrollElements).forEach(key => {
        const scrollElement = this._scrollElements[key];
        requestAnimationFrame.cancel(scrollElement.savePositionHandle);
        scrollElement.savePositionHandle = null;

        // It's fine to save element scroll positions here, though; the browser
        // won't modify them.
        if (!this._ignoreScrollEvents) {
          this._saveElementPosition(key);
        }
      });
    });
  }
github taion / scroll-behavior / src / ScrollBehavior.js View on Github external
_cancelCheckWindowScroll() {
    if (this._checkWindowScrollHandle !== null) {
      requestAnimationFrame.cancel(this._checkWindowScrollHandle);
      this._checkWindowScrollHandle = null;
    }
  }
github taion / scroll-behavior / modules / utils / withScroll.js View on Github external
function cancelCheckScroll() {
    if (checkScrollHandle !== null) {
      requestAnimationFrame.cancel(checkScrollHandle)
      checkScrollHandle = null
    }
  }
github taion / scroll-behavior / src / index.js View on Github external
_cancelCheckWindowScroll() {
    requestAnimationFrame.cancel(this._checkWindowScrollHandle);
    this._checkWindowScrollHandle = null;
  }