Thanks to visit codestin.com
Credit goes to github.com

Skip to content

prevent calling jump() when current jump is not finished #57

@antoinerousseau

Description

@antoinerousseau

I created this wrapper, but it could be included in the lib:

import jump from 'jump.js'

let scrolling

const end = () => {
  scrolling = false
}

const scroll = (to, options) => {
  if (scrolling) {
    return
  }
  scrolling = true
  setTimeout(end, options.duration || 0)
  jump(to, options)
}

export default scroll

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions