Use the Controls to Refresh the data below, and add cities.

The page runs a js script which does the following:
  • registers a service worker
  • sets up listeners and creates functions
  • on startup, populates the city 'cards' with data from localstorage if available, otherwise uses dummy data, until an update is made
  • tries to update the cards with data from cache or via the network
  • loads latest data for city(ies)
  • saves data to localstorage for future use
The service worker does the following:
  • retrieves data from the Yahoo Weather API
  • sets up and manages cache

The project is adapted from Google Codelabs.

Copyright 2016 Google Inc.
Add new city