Created
September 12, 2020 12:49
-
-
Save andregardi/259e410e62fd2f8d82584a01b5097ac8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const newWeatherItem = { ...state.cities[0].weatherStatus.current.weather[0], description: "Clear sky" } | |
const newWeather = [...state.cities[0].weatherStatus.current.weather] | |
newWeather[0] = newWeatherItem | |
const newCurrent = { ...state.cities[0].weatherStatus.current, weather: newWeather } | |
const newWeatherStatus = { ...state.cities[0].weatherStatus, current: newCurrent } | |
const newCities = [...state.cities] | |
newCities[0] = { ...newCities[0], weatherStatus: newWeatherStatus } | |
const newState = { ...state, cities: newCities } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment