Skip to content

Commit 0e156c2

Browse files
committed
Linked titles to code
1 parent 1d745fd commit 0e156c2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- [Generators (ES6)](#generators-es6)
88
- [Async Functions (ES7)](#async-functions-es7)
99

10-
## Callbacks
10+
## [Callbacks](https://.com/vasanthk/async-javascript/blob/master/1-callback.js)
1111
In JavaScript, functions are first-class objects; that is, functions are of the type Object and they can be used in a first-class manner like any other object (String, Array, Number, etc.) since they are in fact objects themselves. They can be “stored in variables, passed as arguments to functions, created within functions, and returned from functions”.
1212

1313
Because functions are first-class objects, we can pass a function as an argument in another function and later execute that passed-in function or even return it to be executed later. This is the essence of using callback functions in JavaScript.
@@ -88,7 +88,7 @@ Here are two solutions to this problem:
8888
* [Callback Hell](http://callbackhell.com/)
8989
* [Avoiding Callback hell in Node.js](http://stackabuse.com/avoiding-callback-hell-in-node-js/)
9090

91-
## Promises
91+
## [Promises](https://.com/vasanthk/async-javascript/blob/master/2-promises.js)
9292
Promises are usually vaguely defined as “a proxy for a value that will eventually become available”. They can be used for both synchronous and asynchronous code flows, although they make asynchronous flows easier to reason about.
9393

9494
Promises can be chained “arbitrarily”, that is to say - you can save a reference to any point in the promise chain and then tack more promises on top of it. This is one of the fundamental points to understanding promises.
@@ -132,7 +132,7 @@ Rejections will also finish the race, and the race promise will be rejected. Thi
132132
* [Promise Patterns & Anti-Patterns](http://www.datchley.name/promise-patterns-anti-patterns/)
133133
* [What’s the deal with jQuery Deferred objects and Promises?](http://www.vasanthk.com/jquery-promises-and-deferred-objects/)
134134

135-
## Generators (ES6)
135+
## [Generators (ES6)](https://.com/vasanthk/async-javascript/blob/master/3-generators.js)
136136
Generators, a new feature of ES6, are functions that can be paused and resumed. This helps with many applications: iterators, asynchronous programming, etc.
137137

138138
Two important applications of generators are:
@@ -200,7 +200,7 @@ The fact that generators-as-observers pause while they wait for input makes them
200200
* [No promises: asynchronous JavaScript with only generators](http://www.2ality.com/2015/03/no-promises.html)
201201
* [ES6 Generators in Depth](https://ponyfoo.com/articles/es6-generators-in-depth)
202202

203-
## Async Functions (ES7)
203+
## [Async Functions (ES7)](https://.com/vasanthk/async-javascript/blob/master/4-async-await.js)
204204
Async functions take the idea of using generators for asynchronous programming and give them their own simple and semantic syntax.
205205

206206
### Converting Promises to Async Functions

0 commit comments

Comments
 (0)