Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aholachek/review-fetch
Code exercises to help you solidify your knowledge of fetch
https://github.com/aholachek/review-fetch
fetch practice
Last synced: 13 days ago
JSON representation
Code exercises to help you solidify your knowledge of fetch
- Host: GitHub
- URL: https://github.com/aholachek/review-fetch
- Owner: aholachek
- Created: 2019-06-27T14:24:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T01:14:31.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T05:47:35.542Z (29 days ago)
- Topics: fetch, practice
- Language: JavaScript
- Size: 1.7 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sometimes it's helpful to review the basic building blocks of front end development. In this repo you'll find a few short exercises you can do to (re)familiarize yourself with the `fetch` function.
This repo asks you to write two wrapper functions, `get` and `post`, that make interacting with the base `fetch` api easier (and add some light additional functionality).
## To get started
1. Clone repo
2. Run `yarn`
3. Run `yarn start`. You should see a page of failing tests on `localhost:8000`.
4. Write code in `index.js` to solve the tests.## Hints
1. Use the [`debugger`](https://developers.google.com/web/tools/chrome-devtools/javascript/) statement liberally to introspect what is being returned by your `fetch` calls.
2. The tests expect your function to return an object that looks like this:
`{ data: {}, error: {} }`, with either `data` or `error` keys depending on whether the `fetch` request succesfully completed.
3. Possible solutions can be found in the `solutions` branch.## Learn about (or review) `fetch`
1. [Using Fetch by Mozilla](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch)
2. [Introduction to Fetch by Google](https://developers.google.com/web/updates/2015/03/introduction-to-fetch)