Narrating Prophetic Monks
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    synchronous-octo-broccolipublic

    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'
    });

    install

    npm i synchronous-octo-broccoli

    Downloadslast 7 days

    2

    version

    1.0.3

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar