/Async

Yet another simple Promises/A+ compliant async flow control using ES6 generators.

Primary LanguageJavaScriptMIT LicenseMIT

Yet another simple Promises/A+ compliant async flow control using ES6 generators.

Travis   Bower   npm   License MIT

  • npm: npm i lib-async

Getting Started

new Async(function* () {

    try {

        const users  = yield getUsers();
        const places = yield getPlaces(users);
        return { users, places };
        
    } catch (error) {
    
        // Any errors in `getUsers` and/or `getPlaces` can be caught.
        showError(error);
    
    }

}).then(collections => {

    // `collections` is now an object of users and places.
    console.log(collections);

);