Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "contra", | ||
"description": "Asynchronous flow control with a functional taste to it", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"homepage": "https://github.com/bevacqua/contra", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -0,1 +1,5 @@ | ||
# 1.1.2 Clown Car | ||
- Removed unnecessary context from event listeners | ||
# 1.1.1 Down the Drain | ||
@@ -2,0 +6,0 @@ |
@@ -157,4 +157,2 @@ (function (Object) { | ||
function _emitter (thing) { | ||
/* jshint validthis:true */ | ||
var me = this; | ||
var evt = {}; | ||
@@ -174,3 +172,3 @@ thing.on = function (type, fn) { | ||
if (!et) { return; } | ||
et.forEach(function emitter (s) { cb(s, args, me); }); | ||
et.forEach(function emitter (s) { cb(s, args); }); | ||
}; | ||
@@ -180,3 +178,3 @@ return thing; | ||
// { name: 'queue', dependencies: ['core'] } | ||
// { name: 'queue', dependencies: ['core', 'emitter'] } | ||
function _queue (worker, concurrency) { | ||
@@ -183,0 +181,0 @@ var q = [], load = 0, max = concurrency || 1, paused; |
@@ -1,1 +0,1 @@ | ||
!function(n){"use strict";function t(t){return"[object Array]"===n.prototype.toString.call(t)}function r(n){return Array.prototype.slice.call(n)}function e(n,t,r){n&&v(function(){n.apply(r||null,t||[])})}function u(n){function t(){r||(r=!0,n.apply(null,arguments))}var r;return t.discard=function(){r=!0},t}function i(n,t,r){var u=n.shift();return u?(r&&r.discard(),e(t,[u]),!0):void 0}function o(){var n=r(arguments),t=n.shift();return function(){var e=r(arguments);t.apply(t,n.concat(e))}}function f(n,t){function o(){var f=u(t);return u(function(){var t=r(arguments),u=n.shift();if(u){if(i(t,f))return;t.push(o()),e(u,t)}else e(f,arguments)})}o()()}function c(o,f){function c(){return u(function(){var n=l.shift(),t=r(arguments),u=o[n];if(a){if(i(t,s))return;p[a]=t.shift()}a=n,u?e(u,[c()]):e(s,[null,p])})}var a,s=u(f),l=n.keys(o),p=t(o)?[]:{};c()()}function a(o,f){function c(n){var t=u(function(){var u=r(arguments);i(u,a,t)||(l[n]=u.shift(),++p===d&&e(a,[null,l]))});return t}var a=u(f),s=n.keys(o),l=t(o)?[]:{},p=0,d=s.length;s.forEach(function(n){e(o[n],[c(n)])})}function s(r,e){return function(u,i,o){var f=n.keys(u),c=t(u)?[]:{};f.forEach(function(n){c[n]=function(t){i(u[n],t)}}),r(c,e?e(u,o):o)}}function l(n){function t(n,t){return function(n){t(n)}}return s(n,t)}function p(r){function e(r,e){return function(u,i){function o(n,t){return!!i[t]}function f(){var t={};return n.keys(r).forEach(function(n){o(null,n)&&(t[n]=r[n])}),t}return u?void e(u):void e(null,t(i)?r.filter(o):f())}}return s(r,e)}function d(n){var t=this,u={};return n.on=function(n,t){u[n]?u[n].push(t):u[n]=[t]},n.emit=function(){var n=r(arguments),i=n.shift(),o=u[i];if("error"===i&&!o)throw 1===n.length?n[0]:n;o&&o.forEach(function(r){e(r,n,t)})},n}function h(r,i){function o(n){var r=n?"unshift":"push";return function(n,u){var i=t(n)?n:[n];i.forEach(function(n){s[r]({t:n,done:u})}),e(f)}}function f(){if(!(a||l>=p)){if(!s.length)return void h.emit("drain");l++;var n=s.pop();r(n.t,u(c.bind(null,n)))}}function c(n,t){l--,e(n.done,[t]),e(f)}var a,s=[],l=0,p=i||1,h=d({push:o(!1),unshift:o(!0),pause:function(){a=!0},resume:function(){a=!1,e(f)},pending:s});return n.defineProperty&&!n.definePropertyPartial&&n.defineProperty(h,"length",{get:function(){return s.length}}),h}var v,m="function"==typeof setImmediate;v="undefined"!=typeof process&&process.nextTick?m?setImmediate:process.nextTick:m?function(n){setImmediate(n)}:function(n){setTimeout(n,0)};var y={curry:o,concurrent:a,series:c,waterfall:f,each:l(a),map:s(a),filter:p(a),queue:h,emitter:d};y.each.series=l(c),y.map.series=s(c),y.filter.series=p(c),"undefined"!=typeof module&&module.exports?module.exports=y:window.contra=y}(Object); | ||
!function(n){"use strict";function t(t){return"[object Array]"===n.prototype.toString.call(t)}function r(n){return Array.prototype.slice.call(n)}function e(n,t,r){n&&v(function(){n.apply(r||null,t||[])})}function u(n){function t(){r||(r=!0,n.apply(null,arguments))}var r;return t.discard=function(){r=!0},t}function i(n,t,r){var u=n.shift();return u?(r&&r.discard(),e(t,[u]),!0):void 0}function o(){var n=r(arguments),t=n.shift();return function(){var e=r(arguments);t.apply(t,n.concat(e))}}function f(n,t){function o(){var f=u(t);return u(function(){var t=r(arguments),u=n.shift();if(u){if(i(t,f))return;t.push(o()),e(u,t)}else e(f,arguments)})}o()()}function c(o,f){function c(){return u(function(){var n=l.shift(),t=r(arguments),u=o[n];if(a){if(i(t,s))return;p[a]=t.shift()}a=n,u?e(u,[c()]):e(s,[null,p])})}var a,s=u(f),l=n.keys(o),p=t(o)?[]:{};c()()}function a(o,f){function c(n){var t=u(function(){var u=r(arguments);i(u,a,t)||(l[n]=u.shift(),++p===d&&e(a,[null,l]))});return t}var a=u(f),s=n.keys(o),l=t(o)?[]:{},p=0,d=s.length;s.forEach(function(n){e(o[n],[c(n)])})}function s(r,e){return function(u,i,o){var f=n.keys(u),c=t(u)?[]:{};f.forEach(function(n){c[n]=function(t){i(u[n],t)}}),r(c,e?e(u,o):o)}}function l(n){function t(n,t){return function(n){t(n)}}return s(n,t)}function p(r){function e(r,e){return function(u,i){function o(n,t){return!!i[t]}function f(){var t={};return n.keys(r).forEach(function(n){o(null,n)&&(t[n]=r[n])}),t}return u?void e(u):void e(null,t(i)?r.filter(o):f())}}return s(r,e)}function d(n){var t={};return n.on=function(n,r){t[n]?t[n].push(r):t[n]=[r]},n.emit=function(){var n=r(arguments),u=n.shift(),i=t[u];if("error"===u&&!i)throw 1===n.length?n[0]:n;i&&i.forEach(function(t){e(t,n)})},n}function h(r,i){function o(n){var r=n?"unshift":"push";return function(n,u){var i=t(n)?n:[n];i.forEach(function(n){s[r]({t:n,done:u})}),e(f)}}function f(){if(!(a||l>=p)){if(!s.length)return void h.emit("drain");l++;var n=s.pop();r(n.t,u(c.bind(null,n)))}}function c(n,t){l--,e(n.done,[t]),e(f)}var a,s=[],l=0,p=i||1,h=d({push:o(!1),unshift:o(!0),pause:function(){a=!0},resume:function(){a=!1,e(f)},pending:s});return n.defineProperty&&!n.definePropertyPartial&&n.defineProperty(h,"length",{get:function(){return s.length}}),h}var v,m="function"==typeof setImmediate;v="undefined"!=typeof process&&process.nextTick?m?setImmediate:process.nextTick:m?function(n){setImmediate(n)}:function(n){setTimeout(n,0)};var y={curry:o,concurrent:a,series:c,waterfall:f,each:l(a),map:s(a),filter:p(a),queue:h,emitter:d};y.each.series=l(c),y.map.series=s(c),y.filter.series=p(c),"undefined"!=typeof module&&module.exports?module.exports=y:window.contra=y}(Object); |
{ | ||
"name": "contra", | ||
"description": "Asynchronous flow control with a functional taste to it", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"homepage": "https://github.com/bevacqua/contra", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -289,5 +289,12 @@ ![contra.png][logo] | ||
q.on('drain', function () { | ||
console.log('all done!'); | ||
// if you enqueue more tasks now, then drain | ||
// will fire again when pending.length reaches 0 | ||
}); | ||
// <- 'job' | ||
// <- 'some' | ||
// <- 'more' | ||
// <- 'all done!' | ||
``` | ||
@@ -294,0 +301,0 @@ |
@@ -157,4 +157,2 @@ (function (Object) { | ||
function _emitter (thing) { | ||
/* jshint validthis:true */ | ||
var me = this; | ||
var evt = {}; | ||
@@ -174,3 +172,3 @@ thing.on = function (type, fn) { | ||
if (!et) { return; } | ||
et.forEach(function emitter (s) { cb(s, args, me); }); | ||
et.forEach(function emitter (s) { cb(s, args); }); | ||
}; | ||
@@ -180,3 +178,3 @@ return thing; | ||
// { name: 'queue', dependencies: ['core'] } | ||
// { name: 'queue', dependencies: ['core', 'emitter'] } | ||
function _queue (worker, concurrency) { | ||
@@ -183,0 +181,0 @@ var q = [], load = 0, max = concurrency || 1, paused; |
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
51730
409
1206