Created
April 16, 2014 22:56
-
-
Save dustingetz/10940534 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Not all of the pipeline is async, but some of it is, so even the non-async functions | |
// get lifted into a promise (a compliant Promises/A+ impl will lift your functions for free) | |
Q.delay(100) | |
.then(function (_) { return { a: 1 }}) | |
.then(function (acc) { return _.extend(acc, { b: 2 }); }) | |
.then(function (acc) { return _.extend(acc, { a: acc.a + 1 }); }) | |
.then(_.bind(this.setState, this)) | |
.done(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment