Comparing version 1.4.1 to 1.4.3
{ | ||
"name": "contra", | ||
"description": "Asynchronous flow control with a functional taste to it", | ||
"version": "1.4.1", | ||
"version": "1.4.3", | ||
"homepage": "https://github.com/bevacqua/contra", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -0,1 +1,5 @@ | ||
# 1.4.3 | ||
- Source code readability | ||
# 1.4.0 | ||
@@ -2,0 +6,0 @@ |
@@ -10,3 +10,3 @@ (function (Object, root) { | ||
function atoa (a, n) { return Array.prototype.slice.call(a, n); } | ||
function cb (fn, args, ctx) { if (!fn) { return; } tick(function run () { fn.apply(ctx || null, args || []); }); } | ||
function debounce (fn, args, ctx) { if (!fn) { return; } tick(function run () { fn.apply(ctx || null, args || []); }); } | ||
function once (fn) { | ||
@@ -24,3 +24,3 @@ var disposed; | ||
var err = args.shift(); | ||
if (err) { if (disposable) { disposable.discard(); } cb(done, [err]); return true; } | ||
if (err) { if (disposable) { disposable.discard(); } debounce(done, [err]); return true; } | ||
} | ||
@@ -60,5 +60,5 @@ | ||
args.push(next()); | ||
cb(step, args); | ||
debounce(step, args); | ||
} else { | ||
cb(d, arguments); | ||
debounce(d, arguments); | ||
} | ||
@@ -80,3 +80,3 @@ }); | ||
function worker (key, next) { | ||
cb(tasks[key], [proceed]); | ||
debounce(tasks[key], [proceed]); | ||
function proceed () { | ||
@@ -169,3 +169,3 @@ var args = atoa(arguments); | ||
evt[type] = et.filter(function emitter (listen) { | ||
cb(listen, args); | ||
debounce(listen, args); | ||
return !listen._once; | ||
@@ -184,3 +184,3 @@ }); | ||
pause: function () { paused = true; }, | ||
resume: function () { paused = false; cb(labor); }, | ||
resume: function () { paused = false; debounce(labor); }, | ||
pending: q | ||
@@ -196,3 +196,3 @@ }); | ||
tasks.forEach(function insert (t) { q[m]({ t: t, done: done }); }); | ||
cb(labor); | ||
debounce(labor); | ||
}; | ||
@@ -206,8 +206,8 @@ } | ||
worker(job.t, once(complete.bind(null, job))); | ||
cb(labor); | ||
debounce(labor); | ||
} | ||
function complete (job) { | ||
load--; | ||
cb(job.done, atoa(arguments, 1)); | ||
cb(labor); | ||
debounce(job.done, atoa(arguments, 1)); | ||
debounce(labor); | ||
} | ||
@@ -214,0 +214,0 @@ return qq; |
{ | ||
"name": "contra", | ||
"description": "Asynchronous flow control with a functional taste to it", | ||
"version": "1.4.1", | ||
"version": "1.4.3", | ||
"homepage": "https://github.com/bevacqua/contra", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -10,3 +10,3 @@ (function (Object, root) { | ||
function atoa (a, n) { return Array.prototype.slice.call(a, n); } | ||
function cb (fn, args, ctx) { if (!fn) { return; } tick(function run () { fn.apply(ctx || null, args || []); }); } | ||
function debounce (fn, args, ctx) { if (!fn) { return; } tick(function run () { fn.apply(ctx || null, args || []); }); } | ||
function once (fn) { | ||
@@ -24,3 +24,3 @@ var disposed; | ||
var err = args.shift(); | ||
if (err) { if (disposable) { disposable.discard(); } cb(done, [err]); return true; } | ||
if (err) { if (disposable) { disposable.discard(); } debounce(done, [err]); return true; } | ||
} | ||
@@ -60,5 +60,5 @@ | ||
args.push(next()); | ||
cb(step, args); | ||
debounce(step, args); | ||
} else { | ||
cb(d, arguments); | ||
debounce(d, arguments); | ||
} | ||
@@ -80,3 +80,3 @@ }); | ||
function worker (key, next) { | ||
cb(tasks[key], [proceed]); | ||
debounce(tasks[key], [proceed]); | ||
function proceed () { | ||
@@ -169,3 +169,3 @@ var args = atoa(arguments); | ||
evt[type] = et.filter(function emitter (listen) { | ||
cb(listen, args); | ||
debounce(listen, args); | ||
return !listen._once; | ||
@@ -184,3 +184,3 @@ }); | ||
pause: function () { paused = true; }, | ||
resume: function () { paused = false; cb(labor); }, | ||
resume: function () { paused = false; debounce(labor); }, | ||
pending: q | ||
@@ -196,3 +196,3 @@ }); | ||
tasks.forEach(function insert (t) { q[m]({ t: t, done: done }); }); | ||
cb(labor); | ||
debounce(labor); | ||
}; | ||
@@ -206,8 +206,8 @@ } | ||
worker(job.t, once(complete.bind(null, job))); | ||
cb(labor); | ||
debounce(labor); | ||
} | ||
function complete (job) { | ||
load--; | ||
cb(job.done, atoa(arguments, 1)); | ||
cb(labor); | ||
debounce(job.done, atoa(arguments, 1)); | ||
debounce(labor); | ||
} | ||
@@ -214,0 +214,0 @@ return qq; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
229774
1