Skip to content

Multiple files changed = multiple reloads. Global debounce? #329

@fregante

Description

@fregante

My gulp workflow sometimes will yield multiple html files (e.g. I change a Jade partial and 3 dependent files are regenerated) within 1-2 seconds. This cause BS to reload as many times as the number of files, sometimes actually missing the last one (incidentally exactly the one I have open in the browser).

Is there a way to debounce these refreshes? Ideally it should happen either:

  • _.debounce(refresh, 1000), a second after the last file changes, or
  • _.debounce(refresh, 1000, {leading:true}), as soon as the first file changes and a second after the last file changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions