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 Sep 8, 2016
1 parent cd47fa3 commit 6b6fbbb
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 @@ -265,8 +265,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 6b6fbbb

Please sign in to comment.