Units & Preferences
Weather information is not equally convenient for every user, so WeatherNow needs a simple way to switch between Celsius and Fahrenheit. In this module, you will make the unit control affect the actual weather data and the values displayed throughout the dashboard.
You will introduce the unit preference into the API request, reload the current weather and forecast when the user switches units, and make sure temperatures and wind speeds use the selected system. You will also persist the user’s choice with local storage so the preference can survive a page refresh.
By the end of the module, changing the unit should feel like a complete application feature rather than a visual toggle: the data, current conditions, statistics, and forecast should all stay in sync.
What to expect:
- Track the selected metric or imperial unit.
- Request weather data using the selected unit.
- Update temperature displays.
- Update wind-speed displays.
- Refresh weather data when the unit changes.
- Persist the preference with
localStorage.