You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Week3/MAKEME.md
+14-7Lines changed: 14 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -37,19 +37,26 @@ The homework for week 3 will build on the work you did in week 2. You will creat
37
37
38
38
This week you will work with all JavaScript files in the `src` folder. The assignment consists of two parts:
39
39
40
-
1. Refactor all `.then()` and `.catch()` methods with `async`/`await` and `try...catch`.
41
-
2. Make your app ARIA-compliant (see below).
42
-
3. Refactor your application to use ES6 classes.
40
+
1. Replace `XMLHttpRequest` with the `fetch` API.
41
+
2. Refactor all `.then()` and `.catch()` methods with `async`/`await` and `try...catch`.
42
+
3. Make your app ARIA-compliant (see below).
43
+
4. Refactor your application to use ES6 classes.
44
+
45
+
#### 2.2.1 Replace XMLHttpRequest with fetch
46
+
47
+
Replace `XMLHttpRequest` in the `fetchJSON` function with `fetch`. Because `fetch` returns a promise out of the box there is no need create a promise yourself with `new Promise(...)`.
48
+
49
+
> `fetch` does not throw an error for HTTP errors. Review the documentation for [`response.ok`](https://developer.mozilla.org/en-US/docs/Web/API/Response/ok) for a clue how detect HTTP errors.
43
50
44
-
#### 2.2.1 async/await
51
+
#### 2.2.2 async/await
45
52
46
53
**Instructions:**
47
54
48
55
1. Refactor all `.then()` and `.catch()` methods with `async`/`await` and `try...catch`.
49
56
50
57
2. Make sure that your error handling code still works. See the week2 MAKEME on how to force an error response from GitHub.
- More on ES6 classes: [ES6 Classes in Depth](https://ponyfoo.com/articles/es6-classes-in-depth)
76
83
77
-
#### 2.2.3 ARIA-compliance (BONUS)
84
+
#### 2.2.4 ARIA-compliance (BONUS)
78
85
79
86
Please review the material from the HTML/CSS module: [Get familiar with Accessible Rich Internet Applications (ARIA)](https://github.com/HackYourFuture/HTML-CSS/tree/master/Week1#get-familiar-with-accessible-rich-internet-applications-aria).
80
87
81
88
For the GitHub application ARIA-compliance means that the Contributors list should either be a native HTML list (i.e. using `ul` and `li` elements) or otherwise marked with an appropriate ARIA **role**. Furthermore, a user should be able to navigate through all interactive elements using the keyboard (e.g., using the **Tab** key). Pressing **Enter** on such an element should be equivalent to clicking the mouse.
82
89
83
-
#### 2.2.4 Handing in your homework
90
+
#### 2.2.5 Handing in your homework
84
91
85
92
If necessary, review the instructions how to [Hand in homework](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/homework_pr.md) using GitHub pull request.
0 commit comments