Skip to content

bdmackie/promise-fu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Promise Fu

A small library providing helpers for working with promises and asynchronous programming.

Installation

npm install promise-fu

Example 1

    var c = new PromiseChain();
    return c.addResolver(f1)
        .addResolvers([f2, f3])
        .addResolver(f4)
        .then(function() {
            console.log("First ran f1, then f2 & f3 in parallel, then joined to run f4 and then finish.");
        });

Example 2

    var c = new PromiseChain();
    return c.addResolver(f1)
    	.fork()
        .addResolver(f2)
        .addResolver(f3)
        .join()
        .addResolver(f4)
        .then(function() {
        	console.log("First ran f1, then f2 & f3 in parallel, then joined to run f4 and then finish.");
        });

Tests

npm test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published