Skip to content

Instantly share code, notes, and snippets.

@dominikkaegi
Last active March 13, 2020 01:02
Show Gist options
  • Save dominikkaegi/63307548ae1d3f51f7424292dbd7cf72 to your computer and use it in GitHub Desktop.
Save dominikkaegi/63307548ae1d3f51f7424292dbd7cf72 to your computer and use it in GitHub Desktop.

🎒Jokes on you:

Background:

When building a frontend application we usually want to interact with some data from a server. Let's build an application which loads jokes from a server and display them for our users.

Your mission:

Create an application which loads jokes from the backend and display them in the browser. We can random jokes from this joke api. Create an application that has three Tabs, one for "General" jokes, one for "Programming" jokes and one for "Knock-knock" jokes. From the API fetch a joke every time the user switches a tab. Make sure you don't introduce any memory leaks and clean any idle callback functions before unmounting a component.

The way of grading:

  • Does the application display has three tabs which display three different types of jokes
  • Does the application clean up any memory leaks

Restrictions:

None, other than using React.

api: https://github.com/15Dkatz/official_joke_api

fetch('https://official-joke-api.appspot.com/jokes/general/random')
    .then(res => res.json())
    .then(data => console.log(data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment