{"action":"created","issue":{"url":"https://api.github.com/repos/vohof/gulp-livereload/issues/79","repository_url":"https://api.github.com/repos/vohof/gulp-livereload","labels_url":"https://api.github.com/repos/vohof/gulp-livereload/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/vohof/gulp-livereload/issues/79/comments","events_url":"https://api.github.com/repos/vohof/gulp-livereload/issues/79/events","html_url":"https://github.com/vohof/gulp-livereload/issues/79","id":67651901,"number":79,"title":"Race condition","user":{"login":"tomekwi","id":4624660,"avatar_url":"https://avatars.githubusercontent.com/u/4624660?v=3","gravatar_id":"","url":"https://api.github.com/users/tomekwi","html_url":"https://github.com/tomekwi","followers_url":"https://api.github.com/users/tomekwi/followers","following_url":"https://api.github.com/users/tomekwi/following{/other_user}","gists_url":"https://api.github.com/users/tomekwi/gists{/gist_id}","starred_url":"https://api.github.com/users/tomekwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomekwi/subscriptions","organizations_url":"https://api.github.com/users/tomekwi/orgs","repos_url":"https://api.github.com/users/tomekwi/repos","events_url":"https://api.github.com/users/tomekwi/events{/privacy}","received_events_url":"https://api.github.com/users/tomekwi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-10T18:14:23Z","updated_at":"2016-02-19T07:00:11Z","closed_at":null,"body":"Hi, and thanks for this great piece of code!\r\n\r\nOur task needs to clean the files before building new ones. Here’s a summary of our output.\r\n\r\n```\r\n[19:45:52] Starting 'demo:clean'...\r\n[19:45:52] Finished 'demo:clean' after 172 ms\r\n...\r\n[19:45:53] Starting 'demo'...\r\n[19:45:53] .../demo/dashboard.html reloaded.\r\n[19:45:53] Finished 'demo' after 5.54 ms\r\n```\r\n\r\nThe problem is that when Chrome reloads the window, it doesn’t manage to find the files. Perhaps the filesystem IO takes too long? BTW, my task looks like this:\r\n\r\n```js\r\ngulp.src(settings.source)\r\n  // do stuff\r\n  .pipe(gulp.dest(settings.targetPath))\r\n  .pipe(livereload())\r\n  .once(\"end\", function () {done();})\r\n  ;\r\n```\r\n\r\nHow about an option `debounce`? It would also prevent triggering 10 reloads one after another when 10 files are changed one after another. So this:\r\n\r\n```js\r\nlivereload.listen(\r\n  { debounce: 200\r\n  });\r\n```\r\n\r\nwould trigger a reload 200 ms after the last change in a series of file changes.\r\n\r\nHere’s a nice interactive explanation of debouncing: http://reactivex.io/documentation/operators/debounce.html"},"comment":{"url":"https://api.github.com/repos/vohof/gulp-livereload/issues/comments/186091544","html_url":"https://github.com/vohof/gulp-livereload/issues/79#issuecomment-186091544","issue_url":"https://api.github.com/repos/vohof/gulp-livereload/issues/79","id":186091544,"user":{"login":"tomekwi","id":4624660,"avatar_url":"https://avatars.githubusercontent.com/u/4624660?v=3","gravatar_id":"","url":"https://api.github.com/users/tomekwi","html_url":"https://github.com/tomekwi","followers_url":"https://api.github.com/users/tomekwi/followers","following_url":"https://api.github.com/users/tomekwi/following{/other_user}","gists_url":"https://api.github.com/users/tomekwi/gists{/gist_id}","starred_url":"https://api.github.com/users/tomekwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomekwi/subscriptions","organizations_url":"https://api.github.com/users/tomekwi/orgs","repos_url":"https://api.github.com/users/tomekwi/repos","events_url":"https://api.github.com/users/tomekwi/events{/privacy}","received_events_url":"https://api.github.com/users/tomekwi/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T07:00:11Z","updated_at":"2016-02-19T07:00:11Z","body":"Hi @leo, thanks for tackling this! I don’t really use gulp anymore – I’m doing my best to keep my builds so simple that an npm script does the job. But thumbs up and the best luck to you!"}}