Quiz 8
Test your knowledge of server communication.
Q. Create a simple API middleware that speaks with the Github user’s API:
https://api.github.com/users/[user name]
The middleware should know to handle an action of type:{ type: 'API', payload: 'Github user name' }
Â
Once getting such an action, it uses fetch()
to get the data from Github and dispatches a new action with the resulting data: { type: 'SET_USER', payload: { name: 'Github user name', data: [Data from API] }}
Get hands-on with 1400+ tech skills courses.