question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple files changed = multiple reloads. Global debounce?

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
shakyShanecommented, Apr 12, 2015

2.6.0 has reload-delay & reload-debounce available on the CLI

1reaction
fregantecommented, Mar 24, 2015

This is a sample project that simulates the behavior with gulp while launching BS from CLI: DOWNLOAD

Keep in mind that I wouldn’t be able to solve the issue it like I did in my second post (i.e. within gulp itself)

gulp # in separate window
browser-sync start --server --files "dist/*.html"  --startPath "dist/a.html"

Demo. Notice how the timestamp changes 3 times

demo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debouncing with multiple hooks - javascript - Stack Overflow
When adjusted to my code, the implementation looks like this: const debounce = (fn, delay) => { let timerId; return (... args) =>...
Read more >
Debouncing watcher tasks with Gulp 4 · Issue #1304 - GitHub
Debounce the gulp.watch handler that restarts Koa. This needs to debounce across multiple files (e.g. if Webpack writes a.js, b.js, ...
Read more >
Use dynamic configuration using push refresh in a .NET Core ...
In this tutorial, you learn how to dynamically update the configuration data for .NET Core apps using push refresh.
Read more >
Throttle & Debounce - devsign
Debounce is always the most recent value when it fires. Throttle feels faster and more responsive. Debounce feels more accurate. Here's a ...
Read more >
Troubleshooting 3650/3850 reloads by stack manager ... - Cisco
From there, ask for those very specific reports from those given switches so the customer does not upload several files. The crashinfo directory ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found