Skip to content

Commit

Permalink
add delay option
Browse files Browse the repository at this point in the history
  • Loading branch information
fgnass committed Jul 10, 2015
1 parent 1fd1b19 commit 9f5c5f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -71,6 +71,7 @@ The following options are supported:
* __bypass__ If set to `true` instant will behave just like express.static(). Defaults to `process.env.NODE_ENV == 'production'`
* __watch__ List of file extensions to watch. Defaults to `['html', 'js', 'css']`
* __prefix__ A prefix to add to the URLs under which the client script and the EventSource are exposed. Defaults to `'/instant'`
* __delay__ Amount of time in milliseconds to wait before triggering a reload. Defaults to `10`

All other options like `etag`, `dotfiles`, `index`, etc. are passed on to [send](https://www.npmjs.com/package/send).

Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Expand Up @@ -45,7 +45,7 @@ module.exports = function(root, opts) {

if (root && opts.watch !== false) {
var urlsByFile = {}
, watcher = filewatcher()
, watcher = filewatcher({ delay: opts.delay })

// when a file is modifed tell all clients to reload it
watcher.on('change', function(file) {
Expand Down

0 comments on commit 9f5c5f5

Please sign in to comment.