promise-with-queue

0.1.1 • Public • Published

QueuePro

Execute a function queue to receive value passed in resolving of the last call function.

You can override the default Promise or use a unique variable for this module. In any of the options you will have all the other standard Promise methods available.

Use

var queue = require("queuepro")

var func = queue([
    new Promise((resolve, reject) => { resolve(1) }),
    data => new Promise((resolve, reject) => { 
        setTimeout(() => {
            resolve(--data)
        }, 3000) 
    }),
    data => new Promise((resolve, reject) => { resolve(++data) }),
])

func.then(data => console.log(data), err => console.error(err))

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    0
    • latest

Version History

Package Sidebar

Install

npm i promise-with-queue

Weekly Downloads

1

Version

0.1.1

License

ISC

Last publish

Collaborators

  • philippeassis