Comparing version 1.0.1 to 1.1.1
@@ -1,6 +0,5 @@ | ||
var Promise = require('pinkie-promise'); | ||
var Queue = module.exports = function (interval) { | ||
this.interval = interval || 1000; | ||
var Queue = module.exports = function (interval, P) { | ||
this.interval = (interval > 0) ? interval : 1000; | ||
this.nextCall = 0; | ||
this.Promise = P || Promise; | ||
}; | ||
@@ -19,5 +18,5 @@ | ||
return new Promise(function (resolve) { | ||
return new this.Promise(function (resolve) { | ||
setTimeout(resolve, remains); | ||
}); | ||
}; |
{ | ||
"name": "queue-up", | ||
"version": "1.0.1", | ||
"version": "1.1.1", | ||
"description": "Simple promise-based function queue", | ||
@@ -26,17 +26,13 @@ "license": "MIT", | ||
"then", | ||
"rate", | ||
"limited", | ||
"interval" | ||
"interval", | ||
"debounce", | ||
"throttle" | ||
], | ||
"dependencies": { | ||
"pinkie-promise": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.2.0", | ||
"pinkie-promise": "^1.0.0", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"envs": [ | ||
"node" | ||
] | ||
} | ||
} |
@@ -43,4 +43,6 @@ # queue-up [![Build Status](https://travis-ci.org/dsblv/queue-up.svg?branch=master)](https://travis-ci.org/dsblv/queue-up) | ||
### `queue = new Queue([interval])` | ||
### `queue = new Queue([interval], [promiseModule])` | ||
Create new instance of Queue. Or several instances if you need different queues. | ||
#### interval | ||
@@ -51,4 +53,9 @@ | ||
Create new instance of Queue. Or several instances if you need different queues. | ||
#### promiseModule | ||
Type: `function` | ||
Pass custom Promise module to use instead of the native one. | ||
### `queue.up()` → `promise` | ||
@@ -55,0 +62,0 @@ |
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
3446
0
69
3
- Removedpinkie-promise@^1.0.0
- Removedpinkie@1.0.0(transitive)
- Removedpinkie-promise@1.0.0(transitive)