synchronous-octo-broccoli

1.0.3 • Public • Published

synchronous-octo-broccoli

Build Status Execute an array of promises, synchronously.

npm install synchronous-octo-broccoli

Usage

const sob = require('synchronous-octo-broccoli');


let testString = '';
const arrayOfPromises = [
    ()=> {
        return new Promise((resolve, reject)=> {
            setTimeout(function () {
                testString += '1';
                resolve();
            }, 10);
        });
    },
    ()=> {
        return new Promise((resolve, reject)=> {
            setTimeout(function () {
                testString += '2';
                resolve();
            }, 200);
        });
        
    },
    ()=> {
        return new Promise((resolve, reject)=> {
            testString += '3';
            resolve(testString);
        });
        
    }];
            
sob(arrayOfPromises).then((d)=>{
    // testString is '123'
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    12
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    12
  • 1.0.2
    0
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i synchronous-octo-broccoli

Weekly Downloads

14

Version

1.0.3

License

MIT

Last publish

Collaborators

  • ninjapixel