MCPcopy Create free account
hub / github.com/pacexy/flow / constructor

Method constructor

packages/epubjs/src/utils/queue.js:207–226  ·  view source on GitHub ↗
(task, args, context)

Source from the content-addressed store, hash-verified

205 */
206class 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
229export default Queue

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected