Skip to content

strongloop-community/handling-callback-hell

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Handling Callback Hell

Practical solutions to asynchronous control flow.

This example repo includes various approaches discussed in the accompanying StrongLoop blog post on managing callback hell. It is required to run Node 0.11.x or higher for the generator examples.

All the dependencies are bundled in the project.

To run the test suite:

npm test

To run individual examples, run each file directly:

node nested.js

Various Control Flow Approaches

  1. nested.js - a nested approach
  2. flat.js - a modular approach
  3. async.js - a async module approach
  4. promise - a promise approach
  5. generator - a generator approach
  6. q-generator - a promise/generator approach

Read the accompanying article for more details on the approaches. The Q Generator was an additional approach not mentioned in the article.

About

Another look at callback hell, Practical solutions to asynchronous control flow

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published