Skip to content

Instantly share code, notes, and snippets.

@zaeem
Last active June 21, 2019 12:21
Show Gist options
  • Save zaeem/40b7a0b7e4c9f5e5742750c2609c0084 to your computer and use it in GitHub Desktop.
Save zaeem/40b7a0b7e4c9f5e5742750c2609c0084 to your computer and use it in GitHub Desktop.

Background: We are going to design a simple weather forcast app that will get and dispaly the weather forecast for specific city.

Tools: Reactjs, React-redux

UI: https://screencast.com/t/JqCaYoPr

API: You can use this api end-point to get the data. where q={city name} http://api.openweathermap.org/data/2.5/weather?q=london,us&APPID=0009cc9a42ea23775a6b261b95b67612

Requirements:

  1. There will be search input, where user will enter city name in it and onchange we will get the data from api. There will be no submit button to submit input's value, api will be called when user stops typing or after 800ms. So there will no multiple api calls.
  2. Store the response data of each api call in the redux store as history data.
  3. Create a left sidebar component where we will just display a list of the history data (name and date). When user which click any item of that list we display its complete data in the right section of the page. (This data will be displayed from the store, there will no api call for that as this is the history of our previous searches.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment