Global

Members

(constant) QUEUE_ERRORS

Source:

(constant) abortHandler

Description:
  • abort handler for handling aborts in your promise

Source:

abort handler for handling aborts in your promise

Example
const promise = (signal) => {
 return new Promise((resolve, reject) => {
     abortHandler(signal, reject);

     setTimeout(resolve, 5000, "resolved");
 });
};

const callback = (res) {
  // handle res here
}
const errHandler = (err) {
  console.log(err.message) //output: "Aborted"
}

queue.add(promise, callback, errHandler)

Type Definitions

errCallback(err) → {void}

Source:
To Do:
  • add support for array input
Example
const pets = () =>{
  return new Promise((resolve, reject) =>{
    setTimeout(reject('rejected'), 100)
  })
}

const callback = (res) => {
 //do something with res
}

const errorCallback = (err) => {
 //do something with error
}

queue.add(pets, callback, errorCallback)
Parameters:
Name Type Description
err Error

The response from the promise

Returns:
Type
void

promiseFunction(signalopt) → {Promise.<unknown>}

Source:
Example
const pets = (signal) =>{
  return new Promise((resolve, reject) =>{
  signal.addEventListener("abort", () => {
   reject("Aborted")
  }
    setTimeout(resolve, 100)
  })
}
Parameters:
Name Type Attributes Description
signal AbortSignal <optional>

The signal for the abort controller for the timeout to abort the promise

Returns:

The promise you want to add to the queue

Type
Promise.<unknown>

resCallback(res) → {void}

Source:
To Do:
  • add support for array input
Example
const pets = () =>{
  return new Promise((resolve, reject) =>{
    setTimeout(resolve('finished'), 100)
  })
}

const callback = (res) => {
 //do something with res
}

queue.add(pets, callback)
Parameters:
Name Type Description
res Object

The response from the promise

Returns:
Type
void