Permalink
Browse files

Fixes wait2/waitAll implementations in the Promises blog post.

  • Loading branch information...
1 parent 44d8db9 commit 4051d4ce2e138efb966c51ab1c4274274c36e899 @robotlolita committed Mar 30, 2016
Showing with 2 additions and 3 deletions.
  1. +2 −3 _posts/2015-11-15-how-do-promises-work.md
@@ -925,8 +925,7 @@ function wait2(promiseA, promiseB, expression) {
With this, we can define `circleAreaPromise` as the following:
{% highlight js linenos=table %}
-var circleAreaPromise = chain(wait2(radiusPromise, piPromise),
- circleAreaAbstraction);
+var circleAreaPromise = wait2(radiusPromise, piPromise, circleAreaAbstraction);
{% endhighlight %}
We could define `wait3` for expressions that depend on three values,
@@ -945,7 +944,7 @@ State Machine, but there is no implicit ordering (besides JavaScript's
own execution semantics).
{% highlight js linenos=table %}
-function waitAll(promises, expression) {
+function waitAll(promises) {
// An array of the values of the promise, which we'll fill in
// incrementally.
var values = new Array(promises.length);

0 comments on commit 4051d4c

Please sign in to comment.