Improve list of prerequisites
This commit is contained in:
parent
d909ecf5c6
commit
518ce2a38a
@ -378,8 +378,32 @@ for (const key in { a: "aaa", b: "bbb" }) {
|
|||||||
|
|
||||||
## Promises
|
## Promises
|
||||||
|
|
||||||
|
This is only going to be an introduction to the magnificent world of promise.
|
||||||
|
|
||||||
|
- Async functions (seen later) use promises as a building block.
|
||||||
|
- Promise are indeed async in nature: the calling code continues executing the promise does its thing.
|
||||||
|
- Some Web API return promises, including `Fetch`
|
||||||
|
|
||||||
### Creating a promise
|
### Creating a promise
|
||||||
|
|
||||||
|
Note: we use TypeScript in this example, to clarify what's return. You can ignore the type annotations for now.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
let isDone: boolean = true
|
||||||
|
|
||||||
|
const thePromise = new Promise((resolve, reject) => {
|
||||||
|
if (isDone) {
|
||||||
|
resolve("the work is done");
|
||||||
|
} else {
|
||||||
|
reject("this is still pending");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.assert(thePromise === 'the work is done')
|
||||||
|
```
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
### Consuming a promise
|
### Consuming a promise
|
||||||
|
|
||||||
### Chaining promises
|
### Chaining promises
|
||||||
|
@ -23,10 +23,11 @@ I am not an expert in front-end development. This should only be considered an i
|
|||||||
|
|
||||||
Assumed knowledge:
|
Assumed knowledge:
|
||||||
|
|
||||||
- HTTP
|
- Basics about HTTP (cookies, protocol, HTTPS)
|
||||||
- Basics about browser
|
- Basics about browser (DOM, using the developer console)
|
||||||
- Basics about HTML and CSS
|
- Basics about HTML and CSS (tags & attributes, how CSS work, CSS selectors, CSS styling)
|
||||||
- Basics about programming languages
|
- Basics about programming languages (conditionals, loops, variables, typing, tests)
|
||||||
|
- Basics about JavaScript (syntax, having written a few hundred lines of code)
|
||||||
|
|
||||||
## To do before the course
|
## To do before the course
|
||||||
|
|
||||||
@ -36,7 +37,7 @@ Read the [grab/front-end-guide](https://github.com/grab/front-end-guide) to get
|
|||||||
|
|
||||||
1. Modern Javascript
|
1. Modern Javascript
|
||||||
2. TypeScript
|
2. TypeScript
|
||||||
3. Intro to React
|
3. React
|
||||||
4. CSS/HTML restart
|
4. CSS/HTML restart
|
||||||
5. Front-end development practices
|
5. Front-end development practices
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user