Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Added try...catch and async/await to week 3 #7

Merged
merged 13 commits into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Here you can find course content and homework for the JavaScript3 modules
|Week|Topic|Read|Homework|
|----|-----|----|--------|
|1.|• Structure for a basic SPA (Single Page Application) <br>• [XMLHttpRequests](../../../fundamentals/blob/master/fundamentals/XMLHttpRequest.md) <br>• API calls|[Reading Week 1](/Week1/README.md)|[Homework Week 1](/Week1/MAKEME.md)|
|2.|• Async vs Sync <br>• [Event Loop (order of execution)](../../../fundamentals/blob/master/fundamentals/event_loop.md)<br>• [Promises](../../../fundamentals/blob/master/fundamentals/promises.md)|[Reading Week 2](/Week2/README.md)|[Homework Week 2](/Week2/MAKEME.md)|
|3.|• [Object Oriented Programming and ES6 Classes](../../../fundamentals/blob/master/fundamentals/oop_classes.md)<br>• [The `this` keyword](../../../fundamentals/blob/master/fundamentals/this.md)<br>• call, apply, bind |[Reading Week 3](/Week3/README.md)|[Homework Week 3](/Week3/MAKEME.md)|
|2.|• [Event Loop (order of execution)](../../../fundamentals/blob/master/fundamentals/event_loop.md)<br>• [Promises](../../../fundamentals/blob/master/fundamentals/promises.md)|[Reading Week 2](/Week2/README.md)|[Homework Week 2](/Week2/MAKEME.md)|
|3.|• [try...catch](../../../fundamentals/blob/master/fundamentals/try_catch.md)<br>• [async/await](../../../fundamentals/blob/master/fundamentals/async_await.md)<br>• [Object Oriented Programming and ES6 Classes](../../../fundamentals/blob/master/fundamentals/oop_classes.md)<br>• [The `this` keyword](../../../fundamentals/blob/master/fundamentals/this.md)<br>• call, apply, bind |[Reading Week 3](/Week3/README.md)|[Homework Week 3](/Week3/MAKEME.md)|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice that you added try.. catch, and async await!


__Kind note:__

We expect you to __always__ come prepared to the class on Sunday.

### Overall
A good understanding of all the above mentioned topics. Want to check your Knowledge? Go through the [JavaScript Fundamentals README](fundamentals/README.md) and research/ ask for help (Slack!) with the concepts that are not entirely clear.
A good understanding of all the above mentioned topics. Want to check your Knowledge? Go through the [JavaScript Fundamentals README](../../../fundamentals/blob/master/README.md) and research/ ask for help (Slack!) with the concepts that are not entirely clear.

*The HackYourFuture curriculum is subject to CC BY copyright. This means you can freely use our materials, but just make sure to give us credit for it :)*
26 changes: 2 additions & 24 deletions Week1/MAKEME.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,17 @@ GitHub API documentation: [List organization repositories](https://developer.git

Note the query string `?per_page=100`. If you don't specify this query string you will only get the first 30 repositories (the default `per_page` is 30 and HYF has more than 30 - but less than 100).

#### Get repository information

You can get information about a specific repository through this API endpoint:

```
https://api.github.com/repos/HackYourFuture/[repositoryName]
```

You should replace `[repositoryName]` with the actual name of the repository.

GitHub API documentation: [Get](https://developer.github.com/v3/repos/#get)

### Get contributor information
#### Get contributor information

The response object that is returned by GitHub from the request to get repository information includes a property with the `contributors_url`. Use the value of this property to make a new request to GitHub to obtain a list of contributors.

Note that, as a result of selecting a repository from the `<select>` element, your code must make two XMLHttpRequests, one after the other:

1. A first request to obtain repository information.
2. A second request using the `contributors_url` obtained from (1) to get a list of contributor information.

Both requests must be done asynchronously.

Making two XMLHttpRequests in a row, where the second requests depends on the response of the first request is part of the assignment. While it is possible to figure out beforehand what the value of the `contributors_url` will be (by carefully reading the documentation), and subsequently make two independent XMLHttpRequests, this is not what is expected.

In the lecture we developed some utility functions to simplify making XMLHttpRequests and creating and manipulating HTML elements. You are free to copy and use these utility functions, but if you do we expect that you can explain how they work.
In the lecture we developed some utility functions to simplify making XMLHttpRequests (function `fetchJSON()`) and creating and manipulating HTML elements (function `createAndAppend()`). You are free to copy and use these utility functions, but if you do we expect that you can explain how they work.

### Refinements

- Make all the repositories link to their own page in GitHub. Use the value of the key: `name` to make this work (hint: GitHub urls always look like this https://api.github.com/repos/HackYourFuture/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`).
- Make sure the link opens in a new tab.


### Important

- Do not duplicate code! This is especially important for making requests since we are making multiple ones with different urls and we want to do different actions based on the call we are making. Here are some handles to get you started:
Expand Down
2 changes: 1 addition & 1 deletion Week1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Here are resources that we like you to read as a preparation for the first lectu

### Fundamentals

- [XMLHttpRequest](../../../fundamentals/blob/master/fundamentals/XMLHttpRequest.md)
- [XMLHttpRequest](../../../../fundamentals/blob/master/fundamentals/XMLHttpRequest.md)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for always correcting my sloppy mistakes :)

### APIs

Expand Down
38 changes: 0 additions & 38 deletions Week1/lecture/.eslintrc

This file was deleted.

59 changes: 0 additions & 59 deletions Week1/lecture/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions Week1/lecture/.vscode/settings.json

This file was deleted.

12 changes: 0 additions & 12 deletions Week1/lecture/1-callback/callback.js

This file was deleted.

32 changes: 0 additions & 32 deletions Week1/lecture/10-xhr-base/app.js

This file was deleted.

16 changes: 0 additions & 16 deletions Week1/lecture/10-xhr-base/index.html

This file was deleted.

46 changes: 0 additions & 46 deletions Week1/lecture/11-xhr-callback/app.js

This file was deleted.

16 changes: 0 additions & 16 deletions Week1/lecture/11-xhr-callback/index.html

This file was deleted.

48 changes: 0 additions & 48 deletions Week1/lecture/12-xhr-render/app.js

This file was deleted.

16 changes: 0 additions & 16 deletions Week1/lecture/12-xhr-render/index.html

This file was deleted.

Loading