Skip to content
Permalink
Browse files

cleanup

  • Loading branch information...
calvinmetcalf committed May 6, 2014
1 parent eb561fb commit b848fc6ab80b4b12cacab4933d9c708dd97992fd
Showing with 8 additions and 12 deletions.
  1. +1 −1 .jshintrc
  2. +0 −4 lib/fakeNextTick.js
  3. +6 −6 lib/index.js
  4. +1 −1 package.json
@@ -4,7 +4,7 @@
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
"node": true,

This file was deleted.

Oops, something went wrong.
@@ -1,7 +1,6 @@
'use strict';
var types = [
require('./nextTick'),
require('./mutation'),
require('./postMessage'),
require('./messageChannel'),
require('./stateChange'),
@@ -24,16 +23,17 @@ function drainQueue() {
}
draining = false;
}
var nextTick;
var scheduleDrain;
var i = -1;
var len = types.length;
while (++ i < len) {
if (types[i].test()) {
nextTick = types[i].install(drainQueue);
scheduleDrain = types[i].install(drainQueue);
break;
}
}
module.exports = function (task) {
module.exports = immediate;
function immediate(task) {
var len, i, args;
var nTask = task;
if (arguments.length > 1 && typeof task === 'function') {
@@ -47,10 +47,10 @@ module.exports = function (task) {
};
}
if ((len = handlerQueue.push(nTask)) === 1 && !draining) {
nextTick(drainQueue);
scheduleDrain();
}
return len;
};
}
module.exports.clear = function (n) {
if (n <= handlerQueue.length) {
handlerQueue[n - 1] = function () {};
@@ -27,7 +27,7 @@
"url": "git://github.com/calvinmetcalf/immediate.git"
},
"browser": {
"./lib/nextTick.js": "./lib/fakeNextTick.js"
"./lib/nextTick.js": "./lib/mutation.js"
},
"bugs": "https://github.com/calvinmetcalf/immediate/issues",
"main": "lib/index.js",

0 comments on commit b848fc6

Please sign in to comment.
You can’t perform that action at this time.