(task, args, context)
| 205 | */ |
| 206 | class Task { |
| 207 | constructor(task, args, context) { |
| 208 | return function () { |
| 209 | var toApply = arguments || [] |
| 210 | |
| 211 | return new Promise((resolve, reject) => { |
| 212 | var callback = function (value, err) { |
| 213 | if (!value && err) { |
| 214 | reject(err) |
| 215 | } else { |
| 216 | resolve(value) |
| 217 | } |
| 218 | } |
| 219 | // Add the callback to the arguments list |
| 220 | toApply.push(callback) |
| 221 | |
| 222 | // Apply all arguments to the functions |
| 223 | task.apply(context || this, toApply) |
| 224 | }) |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | export default Queue |
nothing calls this directly
no outgoing calls
no test coverage detected