Skip to content

Commit

Permalink
Added more links, trying syntax highlighting again.
Browse files Browse the repository at this point in the history
  • Loading branch information
atesgoral committed Jan 26, 2011
1 parent a9cb7ba commit 13119c6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.markdown
Expand Up @@ -23,6 +23,7 @@ Suppose you're firing two (or more) asynchronous operations with callbacks which
may get called in any order and you want to run some code when all callbacks
are called.

```javascript
var result1, result2;

startAsyncOperation1(function (result) {
Expand All @@ -48,6 +49,7 @@ are called.
function processResults() {
// do something with result1 and result2
}
```

We have redundant and repetitive checks to ensure that the result processing is
only done when all results are received. Imagine doing this for not 2 but 3, 4,
Expand All @@ -64,6 +66,7 @@ method names) to let you wait on multiple asynchronous operations (that run
in parallel) and finally execute a function that processes all of their
collected results. Here's a more satisfactory rendition of the scenario above:

```javascript
var satisfaction = new Satisfaction(function (result1, result2) {
// do something with result1 and result2
});
Expand All @@ -79,5 +82,10 @@ collected results. Here's a more satisfactory rendition of the scenario above:
}));

satisfaction.guarantee();
```

See sample.html for a more fanciful example with more verbose comments.
See [sample.html][1] for a more fanciful example with verbose comments. There's also a [Tutorial][2]. See the [API documentation][3] for all the nasty details.

[1]: https://github.com/atesgoral/satisfaction/blob/master/sample.html
[2]: https://github.com/atesgoral/satisfaction/wiki/Tutorial
[3]: https://github.com/atesgoral/satisfaction/wiki/API

0 comments on commit 13119c6

Please sign in to comment.