Skip to content

Kfabb weather-project eval#220

Open
Kfabb wants to merge 2 commits intoprojectshft:masterfrom
Kfabb:master
Open

Kfabb weather-project eval#220
Kfabb wants to merge 2 commits intoprojectshft:masterfrom
Kfabb:master

Conversation

@Kfabb
Copy link

@Kfabb Kfabb commented Dec 17, 2024

No description provided.

currentResults = [];
fiveDayResults = [];
conditionImg = "";
let city = searchInput.value;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is where you can trim it

let conditions = currentResults[0].conditions;

for (let i = 0; i < currentResults.length; i++) {
if (conditions === "Clouds") {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be optimized with a dictionary/object

const weatherIcons = {
  Clouds: clouds,
  Rain: rain,
 ... etc
};
conditionImg = weatherIcons[conditions] || mist;

}
}

function renderFiveDayForecast(fiveDayResults) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functions are massive. contain a lot of logic and need to be refactor with a more single responsibility principle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants