Skip to content

Commit

Permalink
Removing watching/watching.running check
Browse files Browse the repository at this point in the history
Given that `state` should always have the correct value (if the bundle is valid
or not) then we should be able to use ready directly without checking the
watcher.

I also hit a bug where the watcher had running set to false while the bundle was
invalid, leading to a callback being executed immediately instead of waiting.
  • Loading branch information
ibash committed May 30, 2016
1 parent 8044d04 commit 9aa2abf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ module.exports = function(compiler, options) {

webpackDevMiddleware.waitUntilValid = function(callback) {
callback = callback || function(){};
if (!watching || !watching.running) callback();
else ready(callback, {});
ready(callback, {});
};

webpackDevMiddleware.invalidate = function(callback) {
Expand Down

0 comments on commit 9aa2abf

Please sign in to comment.