Comparing version 4.3.0 to 4.3.1
@@ -5,3 +5,3 @@ { | ||
}, | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"bundleDependencies": false, | ||
@@ -24,2 +24,3 @@ "dependencies": { | ||
"objects", | ||
"promises", | ||
"mocha" | ||
@@ -26,0 +27,0 @@ ], |
@@ -34,1 +34,75 @@ # QueueObj | ||
``` | ||
Usage | ||
--------- | ||
```js | ||
var colors = require('colors') | ||
var queue = require("QueueObj"); | ||
class test1 { | ||
process(callback) { | ||
console.log(`processing test1`.cyan) | ||
callback() | ||
} | ||
} | ||
class test2 { | ||
constructor(){ | ||
this.id = 200 | ||
} | ||
process(callback) { | ||
console.log(`processing test2`.cyan) | ||
callback() | ||
} | ||
ping(){ | ||
console.log('hello from test2'.rainbow) | ||
} | ||
} | ||
class test3 { | ||
process(callback) { | ||
console.log(`processing test3`.cyan) | ||
callback() | ||
} | ||
} | ||
let qObj = new queue(), props = { appender: 'array' } | ||
qObj.load(props).add(new test1()).add(new test2()).add(new test3()) | ||
qObj.process({ items: [0, 1] }).then(res => { | ||
console.log(`done with items[0,1]`.green) | ||
qObj.process({ items: [1, 2] }).then(res => { | ||
console.log(`done with items[1,2]`.green) | ||
qObj.process({ items: [2, 1, 2] }).then(res => { | ||
console.log(`done with items[2,1,2]`.green) | ||
qObj.process({ items: [2] }).then(res => { | ||
console.log(`done with item[2]`.green) | ||
qObj.process({ items: [6] }).then(res => { | ||
console.log(`done with item[6]`.green) | ||
}, err => { | ||
console.log(err.red) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
qObj.getObjectById(200).ping() | ||
qObj.process({ byIds: [100, 300] }).then(res => { | ||
console.log(`done with byId: [100, 300]`.bold.italic.underline.yellow) | ||
}) | ||
qObj.process().then(res => { | ||
console.log(`done with all processing`.bold.italic.underline.green) | ||
}) | ||
``` | ||
@@ -9,3 +9,3 @@ const assert = require('assert'), | ||
}, | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"bundleDependencies": false, | ||
@@ -12,0 +12,0 @@ "dependencies": { |
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
23842
108