function useScroller(offset, fps) {
    if (offset === void 0) {
      offset = 0
    }

    if (fps === void 0) {
      fps = 12
    }

    var scrollTop = useWindowScroll(fps)

    var _React$useState = React.useState(false),
      isScrolling = _React$useState[0],
      setIsScrolling = _React$useState[1]

    var didMount = React.useRef(0)

    function _ref() {
      // This is here to prevent premature bail outs while maintaining high resolution
      // unsets. Without it there will always bee a lot of unnecessary DOM writes to style.
      setIsScrolling(false)
    }

    React.useEffect(
      function () {
        if (didMount.current === 1) setIsScrolling(true)
        var to = requestTimeout(_ref, 40 + 1000 / fps)
        didMount.current = 1
        return function () {
          return clearRequestTimeout(to)
        }
      },
      [fps, scrollTop]
    )
    return {
      scrollTop: Math.max(0, scrollTop - offset),
      isScrolling: isScrolling,
    }
  }
/**
   * A hook for tracking whether the `window` is currently being scrolled and it's scroll position on
   * the y-axis. These values are used for determining which grid cells to render and when
   * to add styles to the masonry container that maximize scroll performance.
   *
   * @param offset The vertical space in pixels between the top of the grid container and the top
   *  of the browser `document.documentElement`.
   * @param fps This determines how often (in frames per second) to update the scroll position of the
   *  browser `window` in state, and as a result the rate the masonry grid recalculates its visible cells.
   *  The default value of `12` has been very reasonable in my own testing, but if you have particularly
   *  heavy `render` components it may be prudent to reduce this number.
   */
A hook for tracking whether the `window` is currently being scrolled and it's scroll position on
the y-axis. These values are used for determining which grid cells to render and when
to add styles to the masonry container that maximize scroll performance.

@param offset The vertical space in pixels between the top of the grid container and the top
of the browser `document.documentElement`.
@param fps This determines how often (in frames per second) to update the scroll position of the
browser `window` in state, and as a result the rate the masonry grid recalculates its visible cells.
The default value of `12` has been very reasonable in my own testing, but if you have particularly
heavy `render` components it may be prudent to reduce this number.
A hook for tracking whether the ` window ` is currently being scrolled and it ' s scroll position on the y - axis . These values are used for determining which grid cells to render and when to add styles to the masonry container that maximize scroll performance . @param offset The vertical space in pixels between the top of the grid container and the top of the browser ` document . documentElement ` . @param fps This determines how often ( in frames per second ) to update the scroll position of the browser ` window ` in state and as a result the rate the masonry grid recalculates its visible cells . The default value of ` 12 ` has been very reasonable in my own testing but if you have particularly heavy ` render ` components it may be prudent to reduce this number .
function useScroller(offset, fps) {
    if (offset === void 0) {
      offset = 0
    }
    if (fps === void 0) {
      fps = 12
    }
    var scrollTop = useWindowScroll(fps)
    var _React$useState = React.useState(false),
      isScrolling = _React$useState[0],
      setIsScrolling = _React$useState[1]
    var didMount = React.useRef(0)
    function _ref() {
      setIsScrolling(false)
    }
    React.useEffect(
      function () {
        if (didMount.current === 1) setIsScrolling(true)
        var to = requestTimeout(_ref, 40 + 1000 / fps)
        didMount.current = 1
        return function () {
          return clearRequestTimeout(to)
        }
      },
      [fps, scrollTop]
    )
    return {
      scrollTop: Math.max(0, scrollTop - offset),
      isScrolling: isScrolling,
    }
  }
function useScroller ( offset , fps ) { if ( offset === void 0 ) { offset = 0 } if ( fps === void 0 ) { fps = 12 } var scrollTop = useWindowScroll ( fps ) var _React$useState = React . useState ( false ) , isScrolling = _React$useState [ 0 ] , setIsScrolling = _React$useState [ 1 ] var didMount = React . useRef ( 0 ) function _ref ( ) { setIsScrolling ( false ) } React . useEffect ( function ( ) { if ( didMount . current === 1 ) setIsScrolling ( true ) var to = requestTimeout ( _ref , 40 + 1000 / fps ) didMount . current = 1 return function ( ) { return clearRequestTimeout ( to ) } } , [ fps , scrollTop ] ) return { scrollTop : Math . max ( 0 , scrollTop - offset ) , isScrolling : isScrolling , } }
A hook for tracking whether the `window` is currently being scrolled and it's scroll position on
 the y-axis.
A hook for tracking whether the ` window ` is currently being scrolled and it ' s scroll position on the y - axis .
// This is here to prevent premature bail outs while maintaining high resolution // unsets. Without it there will always bee a lot of unnecessary DOM writes to style.