Skip to content

Instantly share code, notes, and snippets.

@briancavalier
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briancavalier/7d2c9a7f8a29c7bfe7e3 to your computer and use it in GitHub Desktop.
Save briancavalier/7d2c9a7f8a29c7bfe7e3 to your computer and use it in GitHub Desktop.
when.js cookbook

Cookbook

This is a collection of recipes, patterns, and idioms for solving problems with promises.

Promises are an incredibly flexible building block for composing asynchronous operations. They can be used in a variety of ways to solve a variety of problems, and no promise library could provide a convenience API for every situation.

This cookbook is intended to serve as inspiration and to provide jumping-off points that help you compose solutions for your specific situations.

Anti-patterns

Need text

  • promise.spread(p1, p2, ...).join(func). Use when.try(func, p1, p2, ..)
  • Creating new promises unnecessarily. Chain from existing promises
@briancavalier
Copy link
Author

Would be nice to find simple sub-categories at some point, but I think "one big list" will be fine to start with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment