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
You can see `CommandLine` in the URL. These are called "query parameters" and let us specify in detail what we want from the API. Play around with this. For example you can make two buttons that either get data for a specific repository, JavaScript or Node.js. Or go even more crazy and make users type in a search box 'JavaScript' and then send that to the API by changing the repository.
113
113
114
-
<!---
115
-
3. Make a function which takes a single argument. The function should make an XHR request to `localhost:3000/movies?q=[SEARCH_TERM]` where the search term will be the argument. This argument will be the input the user has given you, so make sure that when the user clicks the button you call this function with the argument.
116
-
117
-
Look at the [documentation of the API](https://github.com/typicode/json-server) and see which other query parameters `json-server` support. Mess around with this to see how changing (or adding) parameters modifies your results.
118
-
119
-
4. Use the code from your previous assignment to render the new results. If you have already displayed previous results make sure you clear them (hint: `someElement.removeChild(someChild)`). Make sure you style these results, use a style sheet for this! Also make sure you do not use JavaScript to construct static elements. This way you can handle the positioning of elements easier.
120
-
121
-
5. Change the layout of the page so that you only show a list of movie titles on the left side of your page. When the user hovers over a link (or maybe with a click) you want to show the additional information about the movie (poster, year etc.) on the right column.
122
-
123
-
124
-
-->
125
-
126
-
127
114
```
128
115
How to hand in your homework:
129
116
• Clone your existing "hyf-javascript2" Github repository.
- If you need to refresh your memory on es6 classes: [es6-classes-in-depth](https://ponyfoo.com/articles/es6-classes-in-depth)
12
-
- Also read this article on scopes & closures: [explaining-javascript-scope-and-closures](https://robertnyman.com/2008/10/09/explaining-javascript-scope-and-closures/)
8
+
Give feedback on the SPA (Github API) and git branching homework of one of you fellow students. Please provide the feedback in an issue.
13
9
10
+
## Step 2: Pair programming promises challenge
14
11
15
-
<!-- ###Make this
12
+
>TODO
16
13
17
-
- Resolve your Github issues (DO NOT CLOSE AN ISSUE WITHOUT AN EXPLANATION OF BY REFERENCING IT FROM A COMMIT)
18
-
- Make sure you have implemented map, filter, reduce. If you lack inspiration, ask on Slack.
19
-
- Implement promises in your XHR
20
-
- Add polling to your SPA and make sure new info is loaded every 60 seconds. It's probably not a good idea to do a lot of requests every time so maybe just check if a user has new repos.
21
-
- Add a local data structure in which you ONLY store the info your app needs. So all the properties of your object should be used somewhere in your app. Don't reference the response of the XHR anymore, just reference your own data structure.
22
-
- Make sure you only have one request function that accepts a url parameter and a callback function
23
-
- Implement a loader icon like in [my codepen](https://codepen.io/Razpudding/pen/BRGqJw) for each xhr response the user has to wait for.
24
-
- Add correct HTML/CSS
14
+
_BONUS_ : Code Kata Race
25
15
26
-
If you get stuck, remember we have Slack and you can ask questions. -->
- If you need to refresh your memory on es6 classes: [es6-classes-in-depth](https://ponyfoo.com/articles/es6-classes-in-depth)
18
+
- Also read this article on scopes & closures: [explaining-javascript-scope-and-closures](https://robertnyman.com/2008/10/09/explaining-javascript-scope-and-closures/)
27
19
28
20
>Upload your homework in your "hyf-javascript3" Github repository. Make sure to create a new folder "week2" first.
29
21
Upload your homework files inside the week2 folder and write a description for this “commit”.
0 commit comments